Class ValueReference

All Implemented Interfaces:
IConvertable, IPrimitiveValue, ISingleValue, IValue, Serializable, Comparable<Object>
Direct Known Subclasses:
InstanceReferrer

public class ValueReference extends EntityValue
A value reference is a reference to an attribute of a specific instance. The reference holds both information about the instance and the attribute that is referred.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • ValueReference

      public ValueReference(EntityValue instanceRef, String attribute)
      Constructs a value reference with an instance reference and an attribute name.
      Parameters:
      instanceRef - Object containing the information to uniquely identify an instance.
      attribute - The name of the attribute that is referred.
  • Method Details

    • getReference

      public static ValueReference getReference(IEntityInstance instance, String attributeName)
      This method returns the value reference for an instance and an attribute name.
      Parameters:
      instance - The instance.
      attributeName - The attribute name.
      Returns:
      The value reference object, which is never null
    • getAttributeName

      public String getAttributeName()
      This method returns the attribute name of the attribute this reference points to.
      Returns:
      The attribute name of the reference.
    • toString

      public String toString()
      Overrides:
      toString in class EntityValue
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class EntityValue
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class EntityValue