/** * Returns the attribute values decoded by the supplied transcoder. * * @param <T> type of value * @param oid to match * @param transcoder to decode the binary value * * @return decoded attribute values */ @SuppressWarnings("unchecked") public <T> T[] getAttributeValues(final String oid, final ValueTranscoder<T> transcoder) { final List<T> values = new ArrayList<>(); for (AttributeValueAssertion type : attributeValueAssertions) { if (type.getOid().equals(oid)) { values.add(transcoder.decodeBinaryValue(type.getValue().getBytes())); } } return (T[]) values.toArray(); }
/** * Returns the attribute values decoded by the supplied transcoder. * * @param <T> type of value * @param oid to match * @param transcoder to decode the binary value * * @return decoded attribute values */ @SuppressWarnings("unchecked") public <T> T[] getAttributeValues(final String oid, final ValueTranscoder<T> transcoder) { final List<T> values = new ArrayList<>(); for (AttributeValueAssertion type : attributeValueAssertions) { if (type.getOid().equals(oid)) { values.add(transcoder.decodeBinaryValue(type.getValue().getBytes())); } } return (T[]) values.toArray(); }
/** * Returns the attribute values decoded by the supplied transcoder. * * @param <T> type of value * @param oid to match * @param transcoder to decode the binary value * * @return decoded attribute values */ @SuppressWarnings("unchecked") public <T> T[] getAttributeValues(final String oid, final ValueTranscoder<T> transcoder) { final List<T> values = new ArrayList<>(); for (AttributeValueAssertion type : attributeValueAssertions) { if (type.getOid().equals(oid)) { values.add(transcoder.decodeBinaryValue(type.getValue().getBytes())); } } return (T[]) values.toArray(); }
@Override public byte[] encode() { final ConstructedDEREncoder se = new ConstructedDEREncoder( UniversalDERTag.SEQ, () -> { final OidType type = new OidType(attributeOid); return type.encode(); }, () -> AttributeValueAssertion.this.encode(attributeValue.getBytes())); return se.encode(); }
@Override public byte[] encode() { final ConstructedDEREncoder se = new ConstructedDEREncoder( UniversalDERTag.SEQ, () -> { final OidType type = new OidType(attributeOid); return type.encode(); }, () -> AttributeValueAssertion.this.encode(attributeValue.getBytes())); return se.encode(); }
@Override public byte[] encode() { return AttributeValueAssertion.this.encode(attributeValue.getBytes()); } });