/** * Given a key this method returns the corresponding PartitionPackType * @param partitionTypeKey the key corresponding to this Partition Pack * @return a PartitionPackType corresponding to the PartitionTypeKey that was passed in. * @throws MXFException if an invalid PartitionTypeKey was passed in. */ public static PartitionPackType getPartitionPackTypeKey(Integer partitionTypeKey) throws MXFException{ if(partitionTypeKey.equals(HeaderPartitionPack.getPartitionPackTypeKey())){ return HeaderPartitionPack; } else if(partitionTypeKey.equals(BodyPartitionPack.getPartitionPackTypeKey())){ return BodyPartitionPack; } else if(partitionTypeKey .equals(FooterPartitionPack.getPartitionPackTypeKey())){ return FooterPartitionPack; } else{ throw new MXFException(String.format("Unrecognized partition pack type")); } } }
List<String> getPartitionPacksType(@Nonnull IMFErrorLogger imfErrorLogger) throws IOException { if (this.partitionPacks == null) { setPartitionPacks(imfErrorLogger); } ArrayList<String> partitionPackTypeString = new ArrayList<String>(); for(PartitionPack partitionPack : this.partitionPacks){ partitionPackTypeString.add(partitionPack.getPartitionPackType().getPartitionTypeString()); } return Collections.unmodifiableList(partitionPackTypeString); }
validateHeaderKey(); this.partitionPackType = PartitionPackType.getPartitionPackTypeKey(this.header.getSetOrPackKindKey());