Class PreserveConverter
java.lang.Object
org.btrplace.json.model.constraint.PreserveConverter
- All Implemented Interfaces:
ConstraintConverter<Preserve>
public class PreserveConverter extends Object implements ConstraintConverter<Preserve>
JSON Converter for the constraint
PreserveConverter
.- Author:
- Fabien Hermenier
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PreserveConverter()
-
Method Summary
Modifier and Type Method Description Preserve
fromJSON(Model mo, net.minidev.json.JSONObject o)
Convert a json-encoded constraint.String
getJSONId()
Get the JSON identifier for the constraint.Class<Preserve>
getSupportedConstraint()
Get the name of the constraint that is supported by the converter.net.minidev.json.JSONObject
toJSON(Preserve o)
Serialise a constraint.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.btrplace.json.model.constraint.ConstraintConverter
checkId, toJSONString
-
Constructor Details
-
PreserveConverter
public PreserveConverter()
-
-
Method Details
-
getSupportedConstraint
Description copied from interface:ConstraintConverter
Get the name of the constraint that is supported by the converter.- Specified by:
getSupportedConstraint
in interfaceConstraintConverter<Preserve>
- Returns:
- The constraint class
-
getJSONId
Description copied from interface:ConstraintConverter
Get the JSON identifier for the constraint.- Specified by:
getJSONId
in interfaceConstraintConverter<Preserve>
- Returns:
- a non-empty string
-
fromJSON
Description copied from interface:ConstraintConverter
Convert a json-encoded constraint.- Specified by:
fromJSON
in interfaceConstraintConverter<Preserve>
- Parameters:
mo
- the model to rely ono
- the constraint to decode- Returns:
- the resulting constraint
- Throws:
JSONConverterException
- if the conversion failed
-
toJSON
Description copied from interface:ConstraintConverter
Serialise a constraint.- Specified by:
toJSON
in interfaceConstraintConverter<Preserve>
- Parameters:
o
- the constraint- Returns:
- the resulting encoded constraint
-