@Override public JsonElement doSerialize(Predicate<?> src, Type typeOfSrc, JsonSerializationContext context) { if (src instanceof Serializable) { try { return new JsonPrimitive(serializeObject(src)); } catch (final IOException e) { throw new IllegalArgumentException(e); } } throw new IllegalArgumentException( "All predicates must be serializable, found: " + src.getClass().getName()); } }
@Override public JsonElement doSerialize(Predicate<?> src, Type typeOfSrc, JsonSerializationContext context) { if (src instanceof Serializable) { try { return new JsonPrimitive(serializeObject(src)); } catch (final IOException e) { throw new IllegalArgumentException(e); } } throw new IllegalArgumentException( "All predicates must be serializable, found: " + src.getClass().getName()); } }