com.brightsparklabs.asanti.decoder.builtin.RelativeOidIriDecoder 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#RelativeOidIri}
*
* @author brightSPARK Labs
*/
public class RelativeOidIriDecoder extends AbstractBuiltinTypeDecoder {
// -------------------------------------------------------------------------
// INSTANCE VARIABLES
// -------------------------------------------------------------------------
/** singleton instance */
private static RelativeOidIriDecoder instance;
// -------------------------------------------------------------------------
// CONSTRUCTION
// -------------------------------------------------------------------------
/**
* Default constructor.
*
* This is private, use {@link #getInstance()} to obtain an instance
*/
private RelativeOidIriDecoder() {}
/**
* Returns a singleton instance of this class
*
* @return a singleton instance of this class
*/
public static RelativeOidIriDecoder getInstance() {
if (instance == null) {
instance = new RelativeOidIriDecoder();
}
return instance;
}
// -------------------------------------------------------------------------
// IMPLEMENTATION: AbstractBuiltinTypeDecoder
// -------------------------------------------------------------------------
@Override
public String decode(final byte[] bytes) throws DecodeException {
final ImmutableSet failures =
AsnByteValidator.validateAsRelativeOidIri(bytes);
DecodeExceptions.throwIfHasFailures(failures);
// TODO: ASN-107 implement
return null;
}
}