Package org.soulwing.s2ks
Class SimpleMetadata
- java.lang.Object
-
- org.soulwing.s2ks.SimpleMetadata
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleMetadata.BuilderA builder that producesSimpleMetadatainstances.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SimpleMetadata.Builderbuilder()Gets a builder that builds a new instance.static Metadataempty()Gets an instance that is empty.booleanequals(java.lang.Object obj)<T> Tget(java.lang.String name, java.lang.Class<? extends T> type)Gets a metadata property value.inthashCode()booleanisEmpty()Tests whether this metadata object has any properties.java.util.Set<java.lang.String>names()Gets the names of the properties in this metadata collection.java.util.Map<java.lang.String,java.lang.Object>toMap()Gets the contents of this metadata collection as a map.
-
-
-
Method Detail
-
empty
public static Metadata empty()
Gets an instance that is empty.- Returns:
- empty instance
-
builder
public static SimpleMetadata.Builder builder()
Gets a builder that builds a new instance.- Returns:
- builder
-
isEmpty
public boolean isEmpty()
Description copied from interface:MetadataTests whether this metadata object has any properties.
-
names
public java.util.Set<java.lang.String> names()
Description copied from interface:MetadataGets the names of the properties in this metadata collection.
-
toMap
public java.util.Map<java.lang.String,java.lang.Object> toMap()
Description copied from interface:MetadataGets the contents of this metadata collection as a map.
-
get
public <T> T get(java.lang.String name, java.lang.Class<? extends T> type)Description copied from interface:MetadataGets a metadata property value.As a special case, when retrieving a numeric property value (any of the supported subtypes of
Number, if the stored value is not directly assignable to the specified type, it will be coerced to the specified type using one of methods provided on the Number class for doing so.- Specified by:
getin interfaceMetadata- Type Parameters:
T- return type- Parameters:
name- name of the property to retrieve.type- property type; the underlying implementation will restrict property values to String, Boolean, Integer, Long, Double- Returns:
- property value or
nullif there is no property with the given name
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-