Class MethodArgument

java.lang.Object
org.tentackle.model.MethodArgument

public class MethodArgument extends Object
Argument to use in select- and delete-methods.
Author:
harald
  • Constructor Details

    • MethodArgument

      public MethodArgument(Relation relation, Attribute attribute)
      Creates a method argument.
      Parameters:
      relation - relation for delayed determination of the foreign attribute
      attribute - attribute of the current entity
    • MethodArgument

      public MethodArgument(Relation relation, String foreignAttributeName, Attribute attribute)
      Creates a method argument for another foreign attribute as the relation points to.
      Parameters:
      relation - relation for delayed determination of the foreign attribute
      foreignAttributeName - the name of the foreign attribute
      attribute - attribute of the current entity
    • MethodArgument

      public MethodArgument(Relation relation, String foreignAttributeName, String value)
      Creates a method argument for another foreign attribute as the relation points to.
      If value is a String it must be enclosed in double quotes.
      Parameters:
      relation - relation for delayed determination of the foreign attribute
      foreignAttributeName - the name of the foreign attribute
      value - the fixed value in its representation as a string
  • Method Details

    • isValue

      public boolean isValue()
      Returns whether the method argument is a fixed value.
      Returns:
      true if value, else attribute
    • getForeignAttribute

      public Attribute getForeignAttribute()
      Gets the foreign attribute.
      Returns:
      the attribute of the relation's entity (never null)
    • getAttribute

      public Attribute getAttribute()
      Gets the local attribute.
      Returns:
      the attribute of the local entity, null if fixed value
    • getValue

      public String getValue()
      Gets the fixed value.
      Returns:
      the value (only valid if isValid() == true)
    • getMethodArgument

      public String getMethodArgument()
      Gets the string for the method argument.
      Returns:
      the argument string
    • getSetterMethod

      public String getSetterMethod()
      Gets the name of the setter method of the foreign attribute.
      Returns:
      the setter method
    • toString

      public String toString()
      Overrides:
      toString in class Object