/** * Returns {@link SearchFilter#encodeValue} if value is a string or byte array. * * @param value to encode * * @return encoded value */ private Object encode(final Object value) { if (value instanceof String){ return SearchFilter.encodeValue((String) value); } else if (value instanceof byte[]) { return SearchFilter.encodeValue((byte[]) value); } return value; } }
/** * Returns {@link SearchFilter#encodeValue} if value is a string. * * @param value to encode * * @return encoded value if value is a string */ private Object encode(final Object value) { if (value instanceof String){ return SearchFilter.encodeValue((String) value); } else if (value instanceof byte[]) { return SearchFilter.encodeValue((byte[]) value); } return value; } }
/** * Hex encodes the supplied object if it is of type byte[], otherwise the string format of the object is escaped. See * {@link #escape(String)}. * * @param obj to encode * * @return encoded object */ protected static String encode(final Object obj) { if (obj == null) { return null; } final String str; if (obj instanceof String) { str = encodeValue((String) obj); } else if (obj instanceof byte[]) { str = encodeValue((byte[]) obj); } else { str = encodeValue(obj.toString()); } return str; }
/** * Hex encodes the supplied object if it is of type byte[], otherwise the string format of the object is escaped. See * {@link #escape(String)}. * * @param obj to encode * * @return encoded object */ protected static String encode(final Object obj) { if (obj == null) { return null; } final String str; if (obj instanceof String) { str = encodeValue((String) obj); } else if (obj instanceof byte[]) { str = encodeValue((byte[]) obj); } else { str = encodeValue(obj.toString()); } return str; }
/** * Hex encodes the supplied object if it is of type byte[], otherwise the string format of the object is escaped. See * {@link #escape(String)}. * * @param obj to encode * * @return encoded object */ protected static String encode(final Object obj) { if (obj == null) { return null; } String str; if (obj instanceof String) { str = encodeValue((String) obj); } else if (obj instanceof byte[]) { str = encodeValue((byte[]) obj); } else { str = encodeValue(obj.toString()); } return str; }