Class SymbolicValue.SymEnum

    • Method Detail

      • toEnum

        public <E extends Enum<E>> @Nullable E toEnum​(Class<E> enumClass)
        If this enum constant is declared in the given enum class, returns its value. Otherwise returns null.
        Type Parameters:
        E - Return type
        Parameters:
        enumClass - Class of an enum
      • fromEnum

        public static SymbolicValue fromEnum​(TypeSystem ts,
                                             Enum<?> value)
        Returns the symbolic value for the given enum constant.
        Parameters:
        ts - Type system
        value - An enum constant
        Throws:
        NullPointerException - if the parameter is null
      • fromBinaryName

        public static SymbolicValue.SymEnum fromBinaryName​(TypeSystem ts,
                                                           String enumBinaryName,
                                                           String enumConstName)
        Parameters:
        ts - Type system
        enumBinaryName - A binary name, eg com.MyEnum
        enumConstName - Simple name of the enum constant
        Throws:
        NullPointerException - if any parameter is null
      • fromTypeDescriptor

        public static SymbolicValue.SymEnum fromTypeDescriptor​(TypeSystem ts,
                                                               String enumTypeDescriptor,
                                                               String enumConstName)
        Parameters:
        ts - Type system
        enumTypeDescriptor - The type descriptor, eg Lcom/MyEnum;
        enumConstName - Simple name of the enum constant
      • valueEquals

        public boolean valueEquals​(Object o)
        Description copied from interface: SymbolicValue
        Returns true if this symbolic value represents the same value as the given object. If the parameter is null, returns false.
        Specified by:
        valueEquals in interface SymbolicValue
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object