Package com.youtube.vitess.vtgate.Exceptions

Examples of com.youtube.vitess.vtgate.Exceptions.InvalidFieldException


    return contents.keySet().size();
  }

  public Object getObject(int index) throws InvalidFieldException {
    if (index >= size()) {
      throw new InvalidFieldException("invalid field index " + index);
    }
    return getObject(contents.keySet().asList().get(index));
  }
View Full Code Here


    return getObject(contents.keySet().asList().get(index));
  }

  public Object getObject(String fieldName) throws InvalidFieldException {
    if (!contents.containsKey(fieldName)) {
      throw new InvalidFieldException("invalid field name " + fieldName);
    }
    return contents.get(fieldName).getValue();
  }
View Full Code Here

  }

  private Object getAndCheckType(String fieldName, Class clazz) throws InvalidFieldException {
    Object o = getObject(fieldName);
    if (o != null && !clazz.isInstance(o)) {
      throw new InvalidFieldException(
          "type mismatch expected:" + clazz.getName() + " actual: " + o.getClass().getName());
    }
    return o;
  }
View Full Code Here

TOP

Related Classes of com.youtube.vitess.vtgate.Exceptions.InvalidFieldException

Copyright © 2018 www.massapicom. 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.