Class EntityCodecUtils
java.lang.Object
org.aksw.commons.codec.entity.util.EntityCodecUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Tharmonize(T entity, Supplier<? extends EntityCodec<T>> codecSupplier) static <T> Tharmonize(T entity, EntityCodec<T> codec) Apply decoding to an entity (if applicable) then return the encoded entity Main use case is to remove non-canonical quotes from a strings and then return a new one with canonical quotes.static <T> Treencode(T entity, Supplier<? extends EntityCodec<T>> decodecSupplier, Supplier<? extends EntityCodec<T>> encodecSupplier) static <T> Treencode(T entity, EntityCodec<T> decodec, EntityCodec<T> encodec) If the entity can be decoded with 'decoder' then do so and apply encoder.encode afterwards.
-
Constructor Details
-
EntityCodecUtils
public EntityCodecUtils()
-
-
Method Details
-
harmonize
-
harmonize
Apply decoding to an entity (if applicable) then return the encoded entity Main use case is to remove non-canonical quotes from a strings and then return a new one with canonical quotes. -
reencode
public static <T> T reencode(T entity, Supplier<? extends EntityCodec<T>> decodecSupplier, Supplier<? extends EntityCodec<T>> encodecSupplier) -
reencode
If the entity can be decoded with 'decoder' then do so and apply encoder.encode afterwards. If the entity cannot be decoded then return it unchanged. Useful to change e.g. quoting from double quotes to backticks
-