format/src/main/java/com/github/sadikovi/riff/tree/FilterApi.java
/**
   * Method to convert object into typed expression, throws exception if no match is found
   * @param obj object to convert, must never be null
   * @return typed expression for this object
   */
Method to convert object into typed expression, throws exception if no match is found
@param obj object to convert, must never be null
@return typed expression for this object
Method to convert object into typed expression throws exception if no match is found @param obj object to convert must never be null @return typed expression for this object
protected static TypedExpression objToExpression(Object obj) {
    if (obj == null) {
      throw new NullPointerException("Cannot convert null into typed expression");
    }
    if (obj instanceof Integer) {
      return new IntegerExpression((Integer) obj);
    } else if (obj instanceof Long) {
      return new LongExpression((Long) obj);
    } else if (obj instanceof String) {
      return new UTF8StringExpression(UTF8String.fromString((String) obj));
    } else if (obj instanceof UTF8String) {
      return new UTF8StringExpression((UTF8String) obj);
    } else if (obj instanceof Date) {
      return new DateExpression((Date) obj);
    } else if (obj instanceof Timestamp) {
      return new TimestampExpression((Timestamp) obj);
    } else if (obj instanceof Boolean) {
      return new BooleanExpression((Boolean) obj);
    } else if (obj instanceof Short) {
      return new ShortExpression((Short) obj);
    } else if (obj instanceof Byte) {
      return new ByteExpression((Byte) obj);
    } else {
      throw new UnsupportedOperationException("Object " + obj + " of " + obj.getClass());
    }
  }
protected static TypedExpression objToExpression ( Object obj ) { if ( obj == null ) { throw new NullPointerException ( "Cannot convert null into typed expression" ) ; } if ( obj instanceof Integer ) { return new IntegerExpression ( ( Integer ) obj ) ; } else if ( obj instanceof Long ) { return new LongExpression ( ( Long ) obj ) ; } else if ( obj instanceof String ) { return new UTF8StringExpression ( UTF8String . fromString ( ( String ) obj ) ) ; } else if ( obj instanceof UTF8String ) { return new UTF8StringExpression ( ( UTF8String ) obj ) ; } else if ( obj instanceof Date ) { return new DateExpression ( ( Date ) obj ) ; } else if ( obj instanceof Timestamp ) { return new TimestampExpression ( ( Timestamp ) obj ) ; } else if ( obj instanceof Boolean ) { return new BooleanExpression ( ( Boolean ) obj ) ; } else if ( obj instanceof Short ) { return new ShortExpression ( ( Short ) obj ) ; } else if ( obj instanceof Byte ) { return new ByteExpression ( ( Byte ) obj ) ; } else { throw new UnsupportedOperationException ( "Object " + obj + " of " + obj . getClass ( ) ) ; } }
Method to convert object into typed expression, throws exception if no match is found
 @param obj object to convert, must never be null
 @return typed expression for this object
Method to convert object into typed expression throws exception if no match is found @param obj object to convert must never be null @return typed expression for this object