com.brightsparklabs.asanti.decoder.builtin.EmbeddedPDVDecoder Maven / Gradle / Ivy
/*
* Maintained by brightSPARK Labs.
* www.brightsparklabs.com
*
* Refer to LICENSE at repository root for license details.
*/
package com.brightsparklabs.asanti.decoder.builtin;
import com.brightsparklabs.asanti.common.DecodeExceptions;
import com.brightsparklabs.asanti.exception.DecodeException;
import com.brightsparklabs.asanti.schema.AsnBuiltinType;
import com.brightsparklabs.asanti.validator.AsnByteValidator;
import com.brightsparklabs.asanti.validator.failure.ByteValidationFailure;
import com.google.common.collect.ImmutableSet;
/**
* Decoder for data of type {@link AsnBuiltinType#EmbeddedPDV}
*
* @author brightSPARK Labs
*/
public class EmbeddedPDVDecoder extends AbstractBuiltinTypeDecoder {
// -------------------------------------------------------------------------
// INSTANCE VARIABLES
// -------------------------------------------------------------------------
/** singleton instance */
private static EmbeddedPDVDecoder instance;
// -------------------------------------------------------------------------
// CONSTRUCTION
// -------------------------------------------------------------------------
/**
* Default constructor.
*
* This is private, use {@link #getInstance()} to obtain an instance
*/
private EmbeddedPDVDecoder() {}
/**
* Returns a singleton instance of this class
*
* @return a singleton instance of this class
*/
public static EmbeddedPDVDecoder getInstance() {
if (instance == null) {
instance = new EmbeddedPDVDecoder();
}
return instance;
}
// -------------------------------------------------------------------------
// IMPLEMENTATION: AbstractBuiltinTypeDecoder
// -------------------------------------------------------------------------
@Override
public String decode(final byte[] bytes) throws DecodeException {
final ImmutableSet failures =
AsnByteValidator.validateAsEmbeddedPDV(bytes);
DecodeExceptions.throwIfHasFailures(failures);
// TODO: ASN-107 implement
return null;
}
}