com.payneteasy.tlv.BerTlvs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ber-tlv Show documentation
Show all versions of ber-tlv Show documentation
BER-TLV reader and writer
The newest version!
package com.payneteasy.tlv;
import java.util.ArrayList;
import java.util.List;
public class BerTlvs {
protected BerTlvs(List aTlvs) {
tlvs = aTlvs;
}
public BerTlv find(BerTag aTag) {
for (BerTlv tlv : tlvs) {
BerTlv found = tlv.find(aTag);
if(found!=null) {
return found;
}
}
return null;
}
public List findAll(BerTag aTag) {
List list = new ArrayList();
for (BerTlv tlv : tlvs) {
list.addAll(tlv.findAll(aTag));
}
return list;
}
public List getList() {
return tlvs;
}
private final List tlvs;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BerTlvs berTlvs = (BerTlvs) o;
return tlvs != null ? tlvs.equals(berTlvs.tlvs) : berTlvs.tlvs == null;
}
@Override
public int hashCode() {
return tlvs != null ? tlvs.hashCode() : 0;
}
@Override
public String toString() {
return "BerTlvs{" +
"tlvs=" + tlvs +
'}';
}
}