de.bild.codec.CodecConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of polymorphia Show documentation
Show all versions of polymorphia Show documentation
A very fast POJO codec for MongoDB (used in conjunction with the Mongo Java Driver) that handles generic types as well as polymorphic class hierarchies
The newest version!
package de.bild.codec;
import de.bild.codec.annotations.DecodeUndefinedHandlingStrategy;
import de.bild.codec.annotations.DecodingFieldFailureStrategy;
import de.bild.codec.annotations.DecodingPojoFailureStrategy;
import de.bild.codec.annotations.EncodeNullHandlingStrategy;
/**
* Helper class holding configurations for the PojoCodecProvider
*/
public class CodecConfiguration {
private boolean encodeNulls;
private EncodeNullHandlingStrategy.Strategy encodeNullHandlingStrategy;
private DecodeUndefinedHandlingStrategy.Strategy decodeUndefinedHandlingStrategy;
private DecodingFieldFailureStrategy.Strategy decodingFieldFailureStrategy;
private DecodingPojoFailureStrategy.Strategy decodingPojoFailureStrategy;
public CodecConfiguration(boolean encodeNulls,
EncodeNullHandlingStrategy.Strategy encodeNullHandlingStrategy,
DecodeUndefinedHandlingStrategy.Strategy decodeUndefinedHandlingStrategy,
DecodingFieldFailureStrategy.Strategy decodingFieldFailureStrategy,
DecodingPojoFailureStrategy.Strategy decodingPojoFailureStrategy) {
this.encodeNulls = encodeNulls;
this.encodeNullHandlingStrategy = encodeNullHandlingStrategy;
this.decodeUndefinedHandlingStrategy = decodeUndefinedHandlingStrategy;
this.decodingFieldFailureStrategy = decodingFieldFailureStrategy;
this.decodingPojoFailureStrategy = decodingPojoFailureStrategy;
}
public boolean isEncodeNulls() {
return this.encodeNulls;
}
public EncodeNullHandlingStrategy.Strategy getEncodeNullHandlingStrategy() {
return this.encodeNullHandlingStrategy;
}
public DecodeUndefinedHandlingStrategy.Strategy getDecodeUndefinedHandlingStrategy() {
return this.decodeUndefinedHandlingStrategy;
}
public DecodingFieldFailureStrategy.Strategy getDecodingFieldFailureStrategy() {
return decodingFieldFailureStrategy;
}
public DecodingPojoFailureStrategy.Strategy getDecodingPojoFailureStrategy() {
return decodingPojoFailureStrategy;
}
}