Class LonelyConverter
java.lang.Object
org.btrplace.json.model.constraint.LonelyConverter
- All Implemented Interfaces:
ConstraintConverter<Lonely>
public class LonelyConverter extends Object implements ConstraintConverter<Lonely>
JSON converter for the
Lonely
constraint.- Author:
- Fabien Hermenier
-
Field Summary
-
Constructor Summary
Constructors Constructor Description LonelyConverter()
-
Method Summary
Modifier and Type Method Description Lonely
fromJSON(Model mo, net.minidev.json.JSONObject o)
Convert a json-encoded constraint.String
getJSONId()
Get the JSON identifier for the constraint.Class<Lonely>
getSupportedConstraint()
Get the name of the constraint that is supported by the converter.net.minidev.json.JSONObject
toJSON(Lonely 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
-
LonelyConverter
public LonelyConverter()
-
-
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<Lonely>
- Returns:
- The constraint class
-
getJSONId
Description copied from interface:ConstraintConverter
Get the JSON identifier for the constraint.- Specified by:
getJSONId
in interfaceConstraintConverter<Lonely>
- Returns:
- a non-empty string
-
fromJSON
Description copied from interface:ConstraintConverter
Convert a json-encoded constraint.- Specified by:
fromJSON
in interfaceConstraintConverter<Lonely>
- 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<Lonely>
- Parameters:
o
- the constraint- Returns:
- the resulting encoded constraint
-