Enum PropertyType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<PropertyType>, Type

    public enum PropertyType
    extends java.lang.Enum<PropertyType>
    implements Type
    All supported graph property types.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BOOLEAN
      Boolean type for properties
      DOUBLE
      Double type for properties
      EDGE
      Edge type for properties
      FLOAT
      Float type for properties
      INTEGER
      Integer type for properties
      LOCAL_DATE
      Date type for properties
      LONG
      Long type for properties
      POINT2D
      Point type to save longitude and latitude
      STRING
      String type for properties
      TIME
      Time type for properties
      TIME_WITH_TIMEZONE
      Time with timezone type for properties
      TIMESTAMP
      Timestamp type for properties
      TIMESTAMP_WITH_TIMEZONE
      Timestamp with timezone type for properties
      VERTEX
      Vertex type for properties
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_LABEL  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getDefaultValue()
      Returns the default value that was used to create this PropertyType.
      java.lang.Class<?> getTypeClass()
      Gets the type class.
      static PropertyType getTypeFor​(java.lang.Class<?> typeClass)
      Returns the PropertyType based on a typeClass.
      boolean isNodeOrEdge()
      Returns true if this PropertyType is an edge or node type.
      boolean isNumericType()
      Returns true if this PropertyType is a numeric type.
      boolean isTemporalType()
      Returns true if this PropertyType is a temporal type.
      java.lang.Object parse​(java.lang.String input)
      Parses a string into this property type.
      static boolean parseBoolean​(java.lang.String input)
      Parse boolean value from a string input.
      static PropertyType parsePropertyType​(java.lang.String input)
      Parse PropertyType from a string value.
      static java.time.temporal.Temporal parseTemporal​(java.lang.String input, PropertyType type)  
      java.util.Optional<EntityType> toEntityType()
      Converts this property type to an EntityType.
      java.lang.String toKey()
      Returns the key of this type as string.
      java.lang.String toString()
      Returns the key of this type as string.
      static PropertyType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static PropertyType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • INTEGER

        public static final PropertyType INTEGER
        Integer type for properties
      • LONG

        public static final PropertyType LONG
        Long type for properties
      • FLOAT

        public static final PropertyType FLOAT
        Float type for properties
      • DOUBLE

        public static final PropertyType DOUBLE
        Double type for properties
      • BOOLEAN

        public static final PropertyType BOOLEAN
        Boolean type for properties
      • VERTEX

        public static final PropertyType VERTEX
        Vertex type for properties
      • EDGE

        public static final PropertyType EDGE
        Edge type for properties
      • STRING

        public static final PropertyType STRING
        String type for properties
      • LOCAL_DATE

        public static final PropertyType LOCAL_DATE
        Date type for properties
        Since:
        2.5.0
      • TIME

        public static final PropertyType TIME
        Time type for properties
        Since:
        2.5.0
      • TIMESTAMP

        public static final PropertyType TIMESTAMP
        Timestamp type for properties
        Since:
        2.5.0
      • TIME_WITH_TIMEZONE

        public static final PropertyType TIME_WITH_TIMEZONE
        Time with timezone type for properties
        Since:
        2.5.0
      • TIMESTAMP_WITH_TIMEZONE

        public static final PropertyType TIMESTAMP_WITH_TIMEZONE
        Timestamp with timezone type for properties
        Since:
        2.5.0
      • POINT2D

        public static final PropertyType POINT2D
        Point type to save longitude and latitude
    • Method Detail

      • values

        public static PropertyType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (PropertyType c : PropertyType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PropertyType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getTypeFor

        public static PropertyType getTypeFor​(java.lang.Class<?> typeClass)
        Returns the PropertyType based on a typeClass.
        Parameters:
        typeClass - Use this typeClass to derive the PropertyType
        Returns:
        The PropertyType that belongs to this typeClass
      • parsePropertyType

        public static PropertyType parsePropertyType​(java.lang.String input)
        Parse PropertyType from a string value.
        Parameters:
        input - Value to use to parse a PropertyType from. You can use the output of toString() as input.
        Returns:
        The PropertyType derived from the string input.
      • parseTemporal

        public static java.time.temporal.Temporal parseTemporal​(java.lang.String input,
                                                                PropertyType type)
                                                         throws oracle.pgx.common.GmParseException
        Throws:
        oracle.pgx.common.GmParseException
      • parseBoolean

        public static boolean parseBoolean​(java.lang.String input)
        Parse boolean value from a string input.
        Parameters:
        input - String value to parse as boolean.
        Returns:
        A boolean value that was parsed from the input.
      • getTypeClass

        public java.lang.Class<?> getTypeClass()
        Description copied from interface: Type
        Gets the type class.
        Specified by:
        getTypeClass in interface Type
        Returns:
        the Java class this type maps to
      • getDefaultValue

        public java.lang.Object getDefaultValue()
        Returns the default value that was used to create this PropertyType.
        Returns:
        the default value that was used to create this PropertyType.
      • toKey

        public java.lang.String toKey()
        Description copied from interface: Type
        Returns the key of this type as string.
        Specified by:
        toKey in interface Type
        Returns:
        a JSON string representation of this type
      • toString

        public java.lang.String toString()
        Returns the key of this type as string. See toKey().
        Overrides:
        toString in class java.lang.Enum<PropertyType>
        Returns:
        the String representation of this type, which is the enum key.
      • isNumericType

        public boolean isNumericType()
        Returns true if this PropertyType is a numeric type.
        Returns:
        true if this PropertyType is a numeric type.
      • isTemporalType

        public boolean isTemporalType()
        Returns true if this PropertyType is a temporal type.
        Returns:
        true if this PropertyType is a temporal type.
      • isNodeOrEdge

        public boolean isNodeOrEdge()
        Returns true if this PropertyType is an edge or node type.
        Returns:
        true if this PropertyType is an edge or node type.
      • parse

        public java.lang.Object parse​(java.lang.String input)
                               throws oracle.pgx.common.GmParseException
        Parses a string into this property type.
        Parameters:
        input -
        Returns:
        the parsed object
        Throws:
        oracle.pgx.common.GmParseException - if this property type cannot be parsed.
      • toEntityType

        public java.util.Optional<EntityType> toEntityType()
        Converts this property type to an EntityType.
        Returns:
        An Optional matching this property type. The returned Optional object is empty if this property type cannot be converted to EntityType