Examples of AjSelectionRange


Examples of com.coroptis.cubiculus.rest.model.AjSelectionRange

    @Override
    public Object toJava(JSONValue aValue, Class aRequestedClass) throws MapperException {
  if (aValue.isObject()) {
      final JSONObject jsonObject = (JSONObject) aValue;
      final AjSelectionRange out = new AjSelectionRange();
      final JSONValue fromJsonValue = jsonObject.get("from");
      if (fromJsonValue == null) {
    out.setFrom(-1);
      } else {
    out.setFrom((Integer) JSONMapper.toJava(fromJsonValue, Integer.class));
      }
      final JSONValue toJsonValue = jsonObject.get("to");
      if (toJsonValue == null) {
    out.setTo(Integer.MAX_VALUE);
      } else {
    out.setTo((Integer) JSONMapper.toJava(jsonObject.get("to"), Integer.class));
      }
      return out;
  }
  throw new MapperException("BooleanMapper cannot map: " + aValue.getClass().getName());
    }
View Full Code Here

Examples of com.coroptis.cubiculus.rest.model.AjSelectionRange

  throw new MapperException("BooleanMapper cannot map: " + aValue.getClass().getName());
    }

    @Override
    public JSONValue toJSON(Object aPojo) throws MapperException {
  AjSelectionRange range = (AjSelectionRange) aPojo;
  final JSONObject out = new JSONObject();
  out.getValue().put("from", new JSONString(String.valueOf(range.getFrom())));
  out.getValue().put("to", new JSONString(String.valueOf(range.getTo())));
  return out;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.