/** * 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")); } } }
validateHeaderKey(); this.partitionPackType = PartitionPackType.getPartitionPackTypeKey(this.header.getSetOrPackKindKey());