Class Decision

java.lang.Object
overit.geocall.sql.code.criterion.Criterion
overit.geocall.sql.code.criterion.Decision
All Implemented Interfaces:
Cloneable

public class Decision extends Criterion
The class extends Criterion and it's used to apply a specific criterion if both field and value pass the validation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final Criterion
     
    protected final Match
     
    protected final Match
     
    protected final String
    String about the bug that, if provided, will enable or disable the evaluation of this Decision according to the related enabling value
    So: if this bug is provided and enabling is true, this Decision will be evaluated only in case this bug has been activated if this bug is provided and enabling is false, this Decision will be evaluated only in case this bug has not been activated if this bug is not provided; this Decision will always be evaluated
    protected final boolean
    A boolean value useful in conjunction with the bug value.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Decision(Criterion criterion)
    The class's constructor method.
    Decision(Match forMatch, Match onMatch, Criterion criterion)
    The class's constructor method.
    Decision(Match forMatch, Match onMatch, Criterion criterion, String bug, boolean enabling)
    Creates a new Decision using the provided parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    define(String name, Object value)
    defines the Parts of the operation with all the information to become a fragment.
    boolean
     
    Returns a new Decision with the current _forMatch, _onMatch, _criterion and the provided disabling bug.
    Returns a new Decision with the current _forMatch, _onMatch, _criterion, bug and the provided enabling bug.
    Create a Decision object with the _forMatch value passed by parameter and the current _onMatch, _criterion, bug and enabling objects.
    forName(String pattern)
    Creates a decision which criterion is applied if the field's name (from the given key-value pairs) respect the string pattern.
    If field's name doesn't respect the string pattern, processing continues to check if it's possible to match with another Decision.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not null.
    If value passed is null, processing continues to check if it's possible to match with another Decision.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is null.
    If value passed is not null, processing continues to check if it's possible to match with another Decision.
    forPattern(Class<?> clz, String valuePattern)
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) respect the type Class and the string pattern, passed by parameters.
    If value doesn't respect the string pattern and the type Class, processing continues to check if it's possible to match with another Decision.
    forType(Class<?> type)
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) respect the type Class passed by parameter.
    If value doesn't respect the type Class, processing continues to check if it's possible to match with another Decision.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not a useless collection, that is null or an empty collection.
    If value passed is null or empty, processing continues to check if it's possible to match with another Decision.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not empty and contains the % character (not only the %).
    If value passed is empty or doesn't contains the % character, processing continues to check if it's possible to match with another Decision.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is a not null or empty string.
    If value passed is null or empty, processing continues to check if it's possible to match with another Decision.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is null or empty collection.
    If value passed is not a null or empty collection, processing continues to check if it's possible to match with another Decision.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is null, empty or contains only the % character.
    If value passed is not null,empty and not contains only the % character, processing continues to check if it's possible to match with another Decision.
    Deprecated, for removal: This API element is subject to removal in a future version.
    use forUselessCollection() instead, an improved version that also includes subclasses of Collection.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is a null or empty string.
    If value passed is not null or empty, processing continues to check if it's possible to match with another Decision.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not null.
    If value passed is null, processing continues to check if it's possible to match with another Decision.
    forValueIn(Collection<?> inValues)
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is within the collection "inValues" passed by parameter.
    If value passed is not within the collection "inValues" passed by parameter, processing continues to check if it's possible to match with another Decision.
    forValueOut(Collection<?> outValues)
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not within the collection "outValues" passed by parameter.
    If value passed is within the collection "outValues" passed by parameter, processing continues to check if it's possible to match with another Decision.
    int
     
    Create a Decision object with the onMatch value passed by parameter and the current forMatch and Criterion objects.
    onName(String pattern)
    Creates a decision which criterion is applied if the field's name (from the given key-value pairs) respect the string pattern.
    If field's name doesn't respect the string pattern, processing will stop and will not continue.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not null.
    If value passed is null, processing will stop and will not continue.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is null.
    If value passed is not null, processing will stop and will not continue.
    onPattern(Class<?> clz, String valuePattern)
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) respect the type Class and the string pattern, passed by parameters.
    If value doesn't respect the string pattern and the type Class, processing will stop and will not continue.
    onType(Class<?> type)
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) respect the type Class passed by parameter.
    If value doesn't respect the type Class, processing will stop and will not continue.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not a useless collection, that is null or an empty collection.
    If value passed is null or empty, processing will stop and will not continue.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not empty and contains the % character (not only the %).
    If value passed is empty or doesn't contains the % character, processing will stop and will not continue.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is a not null or empty string.
    If value passed is null or empty, processing will stop and will not continue.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is null or empty collection.
    If value passed is not a null or empty collection, processing will stop and will not continue.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is null, empty or contains only the % character.
    If value passed is not null,empty and not contains only the % character, processing will stop and will not continue.
    Deprecated, for removal: This API element is subject to removal in a future version.
    use onUselessCollection() instead, an improved version that also includes subclasses of Collection.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is a null or empty string.
    If value passed is not null or empty, processing will stop and will not continue.
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not null.
    If value passed is null, processing will stop and will not continue.
    onValueIn(Collection<?> inValues)
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is within the collection "inValues" passed by parameter.
    If value passed is not within the collection "inValues" passed by parameter, processing will stop and will not continue.
    onValueOut(Collection<?> outValues)
    Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not within the collection "outValues" passed by parameter.
    If value passed is within the collection "outValues" passed by parameter, processing will stop and will not continue.

    Methods inherited from class overit.geocall.sql.code.criterion.Criterion

    fieldDepiction

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _forMatch

      protected final Match _forMatch
    • _onMatch

      protected final Match _onMatch
    • _criterion

      protected final Criterion _criterion
    • bug

      protected final String bug
      String about the bug that, if provided, will enable or disable the evaluation of this Decision according to the related enabling value
      So:
      • if this bug is provided and enabling is true, this Decision will be evaluated only in case this bug has been activated
      • if this bug is provided and enabling is false, this Decision will be evaluated only in case this bug has not been activated
      • if this bug is not provided; this Decision will always be evaluated
    • enabling

      protected final boolean enabling
      A boolean value useful in conjunction with the bug value. If bug has been set, this value determines whether the Decision can be evaluated only if the bug has been activated (if enabling is true), or the Decision can be evaluated only if the bug has not been activated (if enabling is false).
  • Constructor Details

    • Decision

      public Decision(Criterion criterion)
      The class's constructor method.
      Parameters:
      criterion - The specific criterion to be applied.
    • Decision

      public Decision(Match forMatch, Match onMatch, Criterion criterion)
      The class's constructor method.
      Parameters:
      forMatch - The field and/or the value that must match in "for" mode.
      onMatch - The field and/or the value that must match in "on" mode.
      criterion - The specific criterion to be applied.
    • Decision

      public Decision(Match forMatch, Match onMatch, Criterion criterion, String bug, boolean enabling)
      Creates a new Decision using the provided parameters.
      Parameters:
      forMatch - the field and/or the value that must match in "for" mode.
      onMatch - the field and/or the value that must match in "on" mode.
      criterion - the specific criterion to be applied.
      bug - String about the bug that will enable or disable the evaluation of this Decision according to the related enabling value.
      enabling - if true, this Decision will be evaluated only in case the related bug has been activated; if false, this Decision will be evaluated only in case the related bug has not been activated.
  • Method Details

    • forMatch

      public Decision forMatch(Match m)
      Create a Decision object with the _forMatch value passed by parameter and the current _onMatch, _criterion, bug and enabling objects.
      Parameters:
      m - The _forMatch object to set in the new Decision.
      Returns:
      A Decision with the _forMatch value passed by parameter and the current _onMatch, _criterion, bug and enabling objects.
    • onMatch

      public Decision onMatch(Match m)
      Create a Decision object with the onMatch value passed by parameter and the current forMatch and Criterion objects.
      Parameters:
      m - The onMatch object to set in the new Decision.
      Returns:
      A Decision with the onMatch value passed by parameter and the current forMatch and Criterion objects.
    • forName

      public Decision forName(String pattern)
      Creates a decision which criterion is applied if the field's name (from the given key-value pairs) respect the string pattern.
      If field's name doesn't respect the string pattern, processing continues to check if it's possible to match with another Decision.
      Parameters:
      pattern - The string with which the field passed as input must match.
      Returns:
      A Decision which criterion is applied if the field's name (from the given key-value pairs) respect the string pattern.
    • forType

      public Decision forType(Class<?> type)
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) respect the type Class passed by parameter.
      If value doesn't respect the type Class, processing continues to check if it's possible to match with another Decision.
      Parameters:
      type - the type Class passed by parameter, with which the value passed as input must respect.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) respect the type Class passed by parameter.
    • forPattern

      public Decision forPattern(Class<?> clz, String valuePattern)
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) respect the type Class and the string pattern, passed by parameters.
      If value doesn't respect the string pattern and the type Class, processing continues to check if it's possible to match with another Decision.
      Parameters:
      clz - The type Class passed by parameter, with which the value passed as input must respect.
      valuePattern - The string with which the value passed as input must match.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) respect the type Class and the string pattern, passed by parameters.
    • forNotNull

      public Decision forNotNull()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not null.
      If value passed is null, processing continues to check if it's possible to match with another Decision.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is not null.
    • forNull

      public Decision forNull()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is null.
      If value passed is not null, processing continues to check if it's possible to match with another Decision.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is null.
    • forUsefulString

      public Decision forUsefulString()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is a not null or empty string.
      If value passed is null or empty, processing continues to check if it's possible to match with another Decision.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is a not null or empty string.
    • forUselessString

      public Decision forUselessString()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is a null or empty string.
      If value passed is not null or empty, processing continues to check if it's possible to match with another Decision.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is a null or empty string.
    • forUsefulLike

      public Decision forUsefulLike()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not empty and contains the % character (not only the %).
      If value passed is empty or doesn't contains the % character, processing continues to check if it's possible to match with another Decision.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is not empty and contains the % character (not only the %).
    • forUselessLike

      public Decision forUselessLike()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is null, empty or contains only the % character.
      If value passed is not null,empty and not contains only the % character, processing continues to check if it's possible to match with another Decision.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is null, empty or contains only the % character.
    • forUselessSet

      @Deprecated(since="13.1", forRemoval=true) public Decision forUselessSet()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use forUselessCollection() instead, an improved version that also includes subclasses of Collection.
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is null or empty set.
      If value passed is not a null or empty set, processing continues to check if it's possible to match with another Decision.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is null or empty set.
    • forUsefulCollection

      public Decision forUsefulCollection()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not a useless collection, that is null or an empty collection.
      If value passed is null or empty, processing continues to check if it's possible to match with another Decision.
      Returns:
      a Decision which criterion is applied if the value passed (from the given key-value pairs) is not a useless collection, that is null or an empty collection.
    • forUselessCollection

      public Decision forUselessCollection()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is null or empty collection.
      If value passed is not a null or empty collection, processing continues to check if it's possible to match with another Decision.
      Returns:
      a Decision which criterion is applied if the value passed (from the given key-value pairs) is null or empty collection.
    • forValueIn

      public Decision forValueIn(Collection<?> inValues)
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is within the collection "inValues" passed by parameter.
      If value passed is not within the collection "inValues" passed by parameter, processing continues to check if it's possible to match with another Decision.
      Parameters:
      inValues - The collection used to check if the passed values is included within it.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is within the collection "inValues" passed by parameter.
    • forValue

      public Decision forValue()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not null.
      If value passed is null, processing continues to check if it's possible to match with another Decision.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is not null.
    • forValueOut

      public Decision forValueOut(Collection<?> outValues)
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not within the collection "outValues" passed by parameter.
      If value passed is within the collection "outValues" passed by parameter, processing continues to check if it's possible to match with another Decision.
      Parameters:
      outValues - The collection used to check if the passed values is not included within it.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is not within the collection "outValues" passed by parameter.
    • forDisablingBug

      public Decision forDisablingBug(@NotNull @NotNull String bug)
      Returns a new Decision with the current _forMatch, _onMatch, _criterion and the provided disabling bug.
      Parameters:
      bug - String about the associated bug that, if activated, will make this Decision unevaluable.
      Returns:
      a new Decision with the current _forMatch, _onMatch, _criterion and the provided disabling bug.
    • forEnablingBug

      public Decision forEnablingBug(@NotNull @NotNull String bug)
      Returns a new Decision with the current _forMatch, _onMatch, _criterion, bug and the provided enabling bug.
      Parameters:
      bug - String about the associated bug that, only if activated, will make this Decision evaluable.
      Returns:
      a new Decision with the current _forMatch, _onMatch, _criterion, bug and the provided enabling bug.
    • onName

      public Decision onName(String pattern)
      Creates a decision which criterion is applied if the field's name (from the given key-value pairs) respect the string pattern.
      If field's name doesn't respect the string pattern, processing will stop and will not continue.
      Parameters:
      pattern - The string with which the field passed as input must match.
      Returns:
      A Decision which criterion is applied if the field's name (from the given key-value pairs) respect the string pattern.
    • onType

      public Decision onType(Class<?> type)
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) respect the type Class passed by parameter.
      If value doesn't respect the type Class, processing will stop and will not continue.
      Parameters:
      type - the type Class passed by parameter, with which the value passed as input must respect.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) respect the type Class passed by parameter.
    • onPattern

      public Decision onPattern(Class<?> clz, String valuePattern)
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) respect the type Class and the string pattern, passed by parameters.
      If value doesn't respect the string pattern and the type Class, processing will stop and will not continue.
      Parameters:
      clz - The type Class passed by parameter, with which the value passed as input must respect.
      valuePattern - The string with which the value passed as input must match.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) respect the type Class and the string pattern, passed by parameters.
    • onNotNull

      public Decision onNotNull()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not null.
      If value passed is null, processing will stop and will not continue.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is not null.
    • onNull

      public Decision onNull()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is null.
      If value passed is not null, processing will stop and will not continue.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is null.
    • onUsefulString

      public Decision onUsefulString()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is a not null or empty string.
      If value passed is null or empty, processing will stop and will not continue.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is a not null or empty string.
    • onUselessString

      public Decision onUselessString()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is a null or empty string.
      If value passed is not null or empty, processing will stop and will not continue.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is a null or empty string.
    • onUsefulLike

      public Decision onUsefulLike()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not empty and contains the % character (not only the %).
      If value passed is empty or doesn't contains the % character, processing will stop and will not continue.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is not empty and contains the % character (not only the %).
    • onUselessLike

      public Decision onUselessLike()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is null, empty or contains only the % character.
      If value passed is not null,empty and not contains only the % character, processing will stop and will not continue.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is null, empty or contains only the % character.
    • onUselessSet

      @Deprecated(since="13.1", forRemoval=true) public Decision onUselessSet()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use onUselessCollection() instead, an improved version that also includes subclasses of Collection.
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is null or empty set.
      If value passed is not a null or empty set, processing will stop and will not continue.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is null or empty set.
    • onUsefulCollection

      public Decision onUsefulCollection()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not a useless collection, that is null or an empty collection.
      If value passed is null or empty, processing will stop and will not continue.
      Returns:
      a Decision which criterion is applied if the value passed (from the given key-value pairs) is not a useless collection, that is null or an empty collection.
    • onUselessCollection

      public Decision onUselessCollection()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is null or empty collection.
      If value passed is not a null or empty collection, processing will stop and will not continue.
      Returns:
      a Decision which criterion is applied if the value passed (from the given key-value pairs) is null or empty collection.
    • onValueIn

      public Decision onValueIn(Collection<?> inValues)
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is within the collection "inValues" passed by parameter.
      If value passed is not within the collection "inValues" passed by parameter, processing will stop and will not continue.
      Parameters:
      inValues - The collection used to check if the passed values is included within it.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is within the collection "inValues" passed by parameter.
    • onValue

      public Decision onValue()
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not null.
      If value passed is null, processing will stop and will not continue.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is not null.
    • onValueOut

      public Decision onValueOut(Collection<?> outValues)
      Creates a Decision which criterion is applied if the value passed (from the given key-value pairs) is not within the collection "outValues" passed by parameter.
      If value passed is within the collection "outValues" passed by parameter, processing will stop and will not continue.
      Parameters:
      outValues - The collection used to check if the passed values is not included within it.
      Returns:
      A Decision which criterion is applied if the value passed (from the given key-value pairs) is not within the collection "outValues" passed by parameter.
    • define

      public Parts define(String name, Object value)
      Description copied from class: Criterion
      defines the Parts of the operation with all the information to become a fragment.
      Specified by:
      define in class Criterion
      Parameters:
      name - the nome of the context field
      value - the current value of the context field
      Returns:
      return null if the Criterion don't find an information, a Parts otherwise. Then Parts con also contain empty strings if the decision is to discard the name and the value
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object