Class ParameterRef

java.lang.Object
de.aristaflow.adept2.model.common.paramref.ParameterRef
All Implemented Interfaces:
LocalisedString, Serializable
Direct Known Subclasses:
IOParameterRef

public class ParameterRef extends Object implements Serializable, LocalisedString
Represents a reference to a parameter in the strings returned by SystemDataConsumers. These parameters are usually node parameters, but parameter references may be used in other contexts as well.

Instances of this class are usually created by one of the utility methods provided by SystemDataTools.

Author:
Patrick Schmidt
See Also:
  • Field Details

    • name

      protected final String name
      The name of the referenced parameter.
    • dataType

      protected final ProcessConstants.AdeptDataType dataType
      The data type of the referenced parameter.
    • udtName

      protected final String udtName
      The name of the UDT or null in case it is not a UDT.
  • Constructor Details

    • ParameterRef

      public ParameterRef(ProcessConstants.AdeptDataType dataType, String name)
      Creates a new parameter reference for a parameter of arbitrary data type except ProcessConstants.AdeptDataType.USERDEFINED.
      Parameters:
      dataType - The type of the parameter of this reference.
      name - The name of the parameter of this reference. This must not be null.
    • ParameterRef

      public ParameterRef(String name, ProcessConstants.AdeptDataType dataType, String udtName)
      Constructs a new ParameterRef with the specified name, data type and name of UDT.
      Parameters:
      name - The name of the referenced parameter. This must not be null or an empty or blank string.
      dataType - The data type of the referenced parameter.
      udtName - The name of the UDT in case it is a UDT and the name is known, null otherwise.
    • ParameterRef

      protected ParameterRef(String name, ProcessConstants.AdeptDataType dataType, String udtName, boolean discriminator)
      Constructs a new ParameterRef with the specified name, data type and name of UDT.
      Parameters:
      name - The name of the referenced parameter. Subclasses can provide null.
      dataType - The data type of the referenced parameter.
      udtName - The name of the UDT in case it is a UDT and the name is known, null otherwise.
      discriminator - An unused parameter to discriminate ParameterRef(String, AdeptDataType, String).
  • Method Details

    • getName

      public String getName()
      Returns the name of the referenced parameter.
      Returns:
      the name of the referenced parameter
    • getDataType

      public ProcessConstants.AdeptDataType getDataType()
      Returns the data type of the referenced parameter.
      Returns:
      the data type of the referenced parameter
    • getUdtName

      public String getUdtName()
      The name of the user-defined type or null in case the parameter is not of user-defined type ore the name is not defined.
      Returns:
      The name of the user-defined type or null.
    • toString

      public String toString()
      Returns a string of the form %<typeId>:<parameterName>% as specified in SystemDataConsumer.
      Overrides:
      toString in class Object
    • toLocalisedString

      public String toLocalisedString(LocalisationFactory locFac, Locale loc)
      Description copied from interface: LocalisedString
      Gets the localised representation of the implementing object. The localisation should be for the designated locale, model objects being Localised should use the designated localisation factory for automatic localisation.
      Specified by:
      toLocalisedString in interface LocalisedString
      Parameters:
      locFac - The localisation factory to be used by Localised model objects. If this is null, do not localise the used Localised attributes.
      loc - The locale for which to get the localised string. If this is null, treat it like Locale.ROOT has been requested.
      Returns:
      The localised (string) representation of the implementing object for the designated locale using the designated localisation factory if appropriate.
    • hashCode

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

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