public Type[] getField(int number) throws HL7Exception { if (number < 1 || number > numFields()) { throw new IllegalArgumentException(String.format("Cannot add field with index %d to unmodifiable segment %s " + " - there are currently only %d fields.", number, getName(), numFields())); } Type[] types = getDelegate().getField(number); Type[] unmodifiableTypes = new Type[types.length]; if (types.length > 0) { for (int i = 0; i < types.length; i++) { unmodifiableTypes[i] = unmodifiableType(types[i]); } } return unmodifiableTypes; }
public Type getField(int number, int rep) throws HL7Exception { Type[] types = getField(number); if (rep >= types.length) { throw new IllegalArgumentException(String.format("Cannot add repetition with index %d to unmodifiable field %d " + " - there are currently only %d fields.", rep, number, types.length)); } return types[rep]; }
public boolean isRequired(int number) throws HL7Exception { return getDelegate().isRequired(number); }
public String[] getNames() { return getDelegate().getNames(); }
public int getLength(int number) throws HL7Exception { return getDelegate().getLength(number); }
public int numFields() { return getDelegate().numFields(); }
public int getMaxCardinality(int number) throws HL7Exception { return getDelegate().getMaxCardinality(number); }
public int getLength(int number) throws HL7Exception { return getDelegate().getLength(number); }
public String[] getNames() { return getDelegate().getNames(); }
public int numFields() { return getDelegate().numFields(); }
public int getMaxCardinality(int number) throws HL7Exception { return getDelegate().getMaxCardinality(number); }
public Type[] getField(int number) throws HL7Exception { if (number < 1 || number > numFields()) { throw new IllegalArgumentException(String.format("Cannot add field with index %d to unmodifiable segment %s " + " - there are currently only %d fields.", number, getName(), numFields())); } Type[] types = getDelegate().getField(number); Type[] unmodifiableTypes = new Type[types.length]; if (types.length > 0) { for (int i = 0; i < types.length; i++) { unmodifiableTypes[i] = unmodifiableType(types[i]); } } return unmodifiableTypes; }
public String encode() throws HL7Exception { return getDelegate().encode(); }
public boolean isRequired(int number) throws HL7Exception { return getDelegate().isRequired(number); }
public String encode() throws HL7Exception { return getDelegate().encode(); }
public Type getField(int number, int rep) throws HL7Exception { Type[] types = getField(number); if (rep >= types.length) { throw new IllegalArgumentException(String.format("Cannot add repetition with index %d to unmodifiable field %d " + " - there are currently only %d fields.", rep, number, types.length)); } return types[rep]; }
@SuppressWarnings("unchecked") private static <T extends Structure> T unmodifiableStructure(T structure) { if (isUnmodifiable(structure)) return structure; if (structure instanceof Message) return (T) new UnmodifiableMessage((Message) structure); if (structure instanceof Group) return (T) new UnmodifiableGroup((Group) structure); return (T) new UnmodifiableSegment((Segment) structure); }
@SuppressWarnings("unchecked") private static <T extends Structure> T unmodifiableStructure(T structure) { if (isUnmodifiable(structure)) return structure; if (structure instanceof Message) return (T) new UnmodifiableMessage((Message) structure); if (structure instanceof Group) return (T) new UnmodifiableGroup((Group) structure); return (T) new UnmodifiableSegment((Segment) structure); }