Class MapEntity

java.lang.Object
com.landawn.abacus.util.MapEntity
All Implemented Interfaces:
Serializable

@Internal public final class MapEntity extends Object implements Serializable
This object is used to store the properties' values of an object. So it should not set or get value for other object's property.
Since:
0.8
Author:
Haiyang Li
See Also:
  • Constructor Details

    • MapEntity

      public MapEntity(String entityName)
      Parameters:
      entityName -
    • MapEntity

      public MapEntity(String entityName, Map<String,Object> props)
      Parameters:
      entityName -
      props -
  • Method Details

    • valueOf

      public static MapEntity valueOf(String entityName)
      Parameters:
      entityName -
      Returns:
    • valueOf

      public static MapEntity valueOf(String entityName, Map<String,Object> props)
      Parameters:
      entityName -
      props -
      Returns:
    • entityName

      public String entityName()
      Returns:
    • get

      public <T> T get(String propName)
      Type Parameters:
      T -
      Parameters:
      propName -
      Returns:
    • get

      public <T> T get(String propName, Class<? extends T> targetType)

      Node: To follow one of general design rules in Abacus, if there is a conversion behind when the source value is not assignable to the target type, put the targetType to last parameter of the method. Otherwise, put the targetTpye to the first parameter of the method.
      Type Parameters:
      T -
      Parameters:
      propName -
      targetType -
      Returns:
    • set

      public MapEntity set(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • set

      public void set(Map<String,Object> nameValues)
      Parameters:
      nameValues -
    • remove

      public Object remove(String propName)
      Parameters:
      propName -
      Returns:
    • removeAll

      public void removeAll(Collection<String> propNames)
      Removes the all.
      Parameters:
      propNames -
    • containsKey

      public boolean containsKey(String propName)
      Parameters:
      propName -
      Returns:
      true, if successful
    • keySet

      public Set<String> keySet()
      Returns the property names which have been set value.
      Returns:
      a collection of signed property names
      See Also:
    • entrySet

      public Set<Map.Entry<String,Object>> entrySet()
      Returns:
    • props

      public Map<String,Object> props()
      Returns:
    • size

      public int size()
      Returns:
    • isEmpty

      public boolean isEmpty()
      Checks if is empty.
      Returns:
      true, if is empty
    • copy

      public MapEntity copy()
      Returns:
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      Parameters:
      obj -
      Returns:
      true, if successful
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
    • builder

      public static MapEntity.MapEntityBuilder builder(String entityName)