Class NamedTypedValue

java.lang.Object
com.appiancorp.suiteapi.type.TypedValue
com.appiancorp.suiteapi.type.NamedTypedValue
All Implemented Interfaces:
com.appiancorp.core.expr.portable.PortableNamedTypedValue, com.appiancorp.core.expr.portable.PortableTypedValue, DeepCloneable, JSONable, JSONCacheable, com.appiancorp.type.HasTypeRef, com.appiancorp.type.NamedType, Serializable, Cloneable
Direct Known Subclasses:
TypedVariable

@GwtCompatible public class NamedTypedValue extends TypedValue implements com.appiancorp.type.NamedType, com.appiancorp.core.expr.portable.PortableNamedTypedValue
This is a simple bean that represents a name, type and value.
See Also:
  • Field Details

    • QNAME

      public static final QName QNAME
  • Constructor Details

    • NamedTypedValue

      public NamedTypedValue()
    • NamedTypedValue

      public NamedTypedValue(TypedValue tv)
    • NamedTypedValue

      public NamedTypedValue(NamedTypedValue ntv)
    • NamedTypedValue

      public NamedTypedValue(TypedValue tv, String name)
    • NamedTypedValue

      public NamedTypedValue(Long instanceType)
    • NamedTypedValue

      public NamedTypedValue(String name, Long instanceType)
    • NamedTypedValue

      public NamedTypedValue(String name, Long instanceType, Object value)
      Creates an instance with the given name, type and value.
      Parameters:
      name - the name
      instanceType - the type id
      value - the value
  • Method Details

    • equals

      public boolean equals(Object obj)
      Description copied from class: TypedValue
      Compares the specified object with this typedValue for equality. Returns true if and only if the specified object is also a typedValue, both typedValues have the same type, and the same value.
      Overrides:
      equals in class TypedValue
      Parameters:
      obj - the object to be compared for equality with this typeValue
      Returns:
      true if the specified object is equal to this typeValue
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class TypedValue
    • getName

      public String getName()
      Gets the name.
      Specified by:
      getName in interface com.appiancorp.type.NamedType
      Specified by:
      getName in interface com.appiancorp.core.expr.portable.PortableNamedTypedValue
      Returns:
      the name
    • setName

      public void setName(String name)
      Sets the name.
      Specified by:
      setName in interface com.appiancorp.type.NamedType
      Parameters:
      name - the name
    • toString

      public String toString()
      Overrides:
      toString in class TypedValue
    • findNtvByName

      public static NamedTypedValue findNtvByName(NamedTypedValue[] ntvs, String name)
      Finds the NamedTypedValue object in the given array that has the given name. If no such named value can be found, returns null.
      Parameters:
      ntvs - the NamedTypedValue array in which to look for the name
      name - the name to look for
      Returns:
      the NamedTypedValue object that has that name. Null if not found.
    • findNtvIndexByName

      public static int findNtvIndexByName(NamedTypedValue[] ntvs, String name)
      Finds the index of the NamedTypedValue in the given array that has the given name. If no such named value can be found, returns -1.
      Parameters:
      ntvs - the NamedTypedValue array in which to look for the name
      name - the name to look for
      Returns:
      the index of the NamedTypedValue object in the array, -1 if not found.
    • getNtvNames

      public static List<String> getNtvNames(Collection<? extends NamedTypedValue> ntvs)
      Returns the names of the given NamedTypedValues. If the given collection has a consistent iteration order, the returned names will be in the same order as the collection items.