Class ObjectMapper.BoundInstance
- java.lang.Object
-
- ninja.leaping.configurate.objectmapping.ObjectMapper.BoundInstance
-
- Enclosing class:
- ObjectMapper<T>
public class ObjectMapper.BoundInstance extends Object
Represents an object mapper bound to a certain instance of the object
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBoundInstance(T boundInstance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetInstance()Return the instance this mapper is bound to.Tpopulate(ConfigurationNode source)Populate the annotated fields in a pre-created objectvoidserialize(ConfigurationNode target)Serialize the data contained in annotated fields to the configuration node.
-
-
-
Constructor Detail
-
BoundInstance
protected BoundInstance(T boundInstance)
-
-
Method Detail
-
populate
public T populate(ConfigurationNode source) throws ObjectMappingException
Populate the annotated fields in a pre-created object- Parameters:
source- The source to get data from- Returns:
- The object provided, for easier chaining
- Throws:
ObjectMappingException- If an error occurs while populating data
-
serialize
public void serialize(ConfigurationNode target) throws ObjectMappingException
Serialize the data contained in annotated fields to the configuration node.- Parameters:
target- The target node to serialize to- Throws:
ObjectMappingException- if serialization was not possible due to some error.
-
getInstance
public T getInstance()
Return the instance this mapper is bound to.- Returns:
- The active instance
-
-