Class XPropertyValue

java.lang.Object
de.xima.fc.form.common.models.XPropertyValue
All Implemented Interfaces:
Serializable

public class XPropertyValue extends Object implements Serializable
See Also:
  • Constructor Details

    • XPropertyValue

      public XPropertyValue(XPropertyEnum xProperty, Object value)
    • XPropertyValue

      public XPropertyValue(String xPropertyName, Object value)
  • Method Details

    • getXPropertyEnum

      public XPropertyEnum getXPropertyEnum()
    • getPropertyName

      public String getPropertyName()
    • get

      public Object get()
    • getInt

      public Integer getInt()
    • getLong

      public Long getLong()
    • getDouble

      public Double getDouble()
    • getString

      public String getString()
    • getUUID

      public UUID getUUID()
    • getBoolean

      public Boolean getBoolean()
    • getJSONArray

      public com.alibaba.fastjson.JSONArray getJSONArray()
    • getJSONObject

      public com.alibaba.fastjson.JSONObject getJSONObject()
    • setValue

      public void setValue(Object value)
    • clone

      protected XPropertyValue clone()
      Overrides:
      clone in class Object
    • getDefaultBoolean

      public boolean getDefaultBoolean()
    • getDefaultBoolean

      public boolean getDefaultBoolean(boolean defaultValue)
    • getDefaultLong

      public long getDefaultLong(long defaultValue)
      Returns the value as a long. If the value is null or cannot be parsed as a long, returns the default value.
      Returns:
      The value as a long, or the default value if the value is null or cannot be parsed as a long.
    • getChar

      public Character getChar()
      Returns the first character of the value as a char. If the value is null or empty, returns null.
      Returns:
      The first character of the value as a char, or null if the value is null or empty.
    • getDefaultChar

      public char getDefaultChar(char defaultValue)
      Returns the first character of the value as a char. If the value is null or empty, returns the default value.
      Parameters:
      defaultValue - The default value to return if the value is null or empty.
      Returns:
      The first character of the value as a char, or the default value if the value is null or empty.
    • getEnum

      public <E extends Enum<E>> E getEnum(Class<E> enumClass)
      Reads the value as a string and tries to parse it as an enum. If the value is null or cannot be parsed as an enum, returns null.
      Type Parameters:
      E - The enum type.
      Parameters:
      enumClass - The enum class to parse the value as.
      Returns:
      The value as an enum, or the default value if the value is null or cannot be parsed as an enum.
    • getEnum

      public <E extends Enum<E>> E getEnum(Function<String,E> enumParser)
      Reads the value as a string and tries to parse it as an enum. If the value is null or cannot be parsed as an enum, returns null.
      Type Parameters:
      E - The enum type.
      Parameters:
      enumParser - Parser for obtaining the enum from the string.
      Returns:
      The value as an enum, or the default value if the value is null or cannot be parsed as an enum.
    • getDefaultEnum

      public <E extends Enum<E>> E getDefaultEnum(Class<E> enumClass, E defaultValue)
      Reads the value as a string and tries to parse it as an enum. If the value is null or cannot be parsed as an enum, the default value is returned.
      Type Parameters:
      E - The enum type.
      Parameters:
      enumClass - The enum class to parse the value as.
      defaultValue - The default value to return if the value is null or cannot be parsed as an enum.
      Returns:
      The value as an enum, or the default value if the value is null or cannot be parsed as an enum.
    • getDefaultEnum

      public <E extends Enum<E>> E getDefaultEnum(Function<String,E> enumParser, E defaultValue)
      Reads the value as a string and tries to parse it as an enum. If the value is null or cannot be parsed as an enum, the default value is returned.
      Type Parameters:
      E - The enum type.
      Parameters:
      enumParser - Parser for obtaining the enum from the string.
      defaultValue - The default value to return if the value is null or cannot be parsed as an enum.
      Returns:
      The value as an enum, or the default value if the value is null or cannot be parsed as an enum.
    • getDefaultString

      public String getDefaultString()
      Similar to getString(), but returns an empty string if the value is null.
      Returns:
      The value as a string, or an empty string if the value is null.
    • getDefaultString

      public String getDefaultString(String defaultValue)
      Similar to getString(), but returns the default value if the value is null.
      Parameters:
      defaultValue - The default value to return if the value is null.
      Returns:
      The value as a string, or the default value if the value is null.
    • getDefaultStringIfEmpty

      public String getDefaultStringIfEmpty(String defaultValue)
      Similar to getString(), but returns the default value if the value is null or empty.
      Parameters:
      defaultValue - The default value to return if the value is null or empty.
      Returns:
      The value as a string, or the default value if the value is null or empty.
    • getDefaultStringIfBlank

      public String getDefaultStringIfBlank(String defaultValue)
      Similar to getString(), but returns the default value if the value is null or blank.
      Parameters:
      defaultValue - The default value to return if the value is null or blank.
      Returns:
      The value as a string, or the default value if the value is null or blank.
    • getDefaultInt

      public int getDefaultInt()
    • getDefaultInt

      public int getDefaultInt(int defaultValue)
    • getDefaultDouble

      public double getDefaultDouble()
    • getDefaultDouble

      public double getDefaultDouble(double defaultValue)
    • getDefaultJSONArray

      public com.alibaba.fastjson.JSONArray getDefaultJSONArray()
    • getDefaultJSONObject

      public com.alibaba.fastjson.JSONObject getDefaultJSONObject()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object