@Test(expected = IllegalArgumentException.class) public void bytesLessThanObjectLength() { LegacyObjectMetadata.fromBytes(new byte[LegacyObjectMetadata.OBJECT_SIZE - 1]); }
public static LegacyObjectMetadata fromBytes(final byte[] objectBytes) { checkNotNull(objectBytes); checkArgument(objectBytes.length == OBJECT_SIZE, String.format("objectName length must be == %s", OBJECT_SIZE) + " [%s]", objectBytes.length); return new LegacyObjectMetadata(ByteBuffer.allocate(OBJECT_SIZE).put(objectBytes)); }
LegacyObjectMetadata implements ObjectMetadata { public static LegacyObjectMetadata fromBytes(final byte[] objectBytes) { checkNotNull(objectBytes); checkArgument(objectBytes.length == OBJECT_SIZE, String.format("objectName length must be == %s", OBJECT_SIZE) + " [%s]", objectBytes.length); return new LegacyObjectMetadata(ByteBuffer.allocate(OBJECT_SIZE).put(objectBytes)); } }
LegacyObjectMetadata implements ObjectMetadata { public static LegacyObjectMetadata fromBytes(final byte[] objectBytes) { checkNotNull(objectBytes); checkArgument(objectBytes.length == OBJECT_SIZE, String.format("objectName length must be == %s", OBJECT_SIZE) + " [%s]", objectBytes.length); return new LegacyObjectMetadata(ByteBuffer.allocate(OBJECT_SIZE).put(objectBytes)); } protected  LegacyObjectMetadata(final ByteBuffer objectBuffer); }
LegacyObjectMetadata implements ObjectMetadata { public static LegacyObjectMetadata fromBytes(final byte[] objectBytes) { checkNotNull(objectBytes); checkArgument(objectBytes.length == OBJECT_SIZE, String.format("objectName length must be == %s", OBJECT_SIZE) + " [%s]", objectBytes.length); return new LegacyObjectMetadata(ByteBuffer.allocate(OBJECT_SIZE).put(objectBytes)); } protected  LegacyObjectMetadata(final ByteBuffer objectBuffer); static LegacyObjectMetadata fromBytes(final byte[] objectBytes); static LegacyObjectMetadata fromMetadata(final String objectName, final long objectSize,
      final int containerSuffix, final byte numLegalHolds, final int retentionPeriod); @Override String getName(); @Override long getSize(); @Override int getContainerSuffix(); @Override int getNumberOfLegalHolds(); @Override int getRetention(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override int compareTo(final ObjectMetadata o); @Override byte[] toBytes(); @Override String toString(); }
LegacyObjectMetadata implements ObjectMetadata { public static LegacyObjectMetadata fromBytes(final byte[] objectBytes) { checkNotNull(objectBytes); checkArgument(objectBytes.length == OBJECT_SIZE, String.format("objectName length must be == %s", OBJECT_SIZE) + " [%s]", objectBytes.length); return new LegacyObjectMetadata(ByteBuffer.allocate(OBJECT_SIZE).put(objectBytes)); } protected  LegacyObjectMetadata(final ByteBuffer objectBuffer); static LegacyObjectMetadata fromBytes(final byte[] objectBytes); static LegacyObjectMetadata fromMetadata(final String objectName, final long objectSize,
      final int containerSuffix, final byte numLegalHolds, final int retentionPeriod); @Override String getName(); @Override long getSize(); @Override int getContainerSuffix(); @Override int getNumberOfLegalHolds(); @Override int getRetention(); @Override boolean equals(final Object obj); @Override int hashCode(); @Override int compareTo(final ObjectMetadata o); @Override byte[] toBytes(); @Override String toString(); static final int OBJECT_NAME_SIZE; static final int OBJECT_SIZE_SIZE; static final int OBJECT_SUFFIX_SIZE; static final int OBJECT_LEGAL_HOLDS_SIZE; static final int OBJECT_RETENTION_SIZE; static final int OBJECT_SIZE; static final byte MAJOR_VERSION; static final byte MINOR_VERSION; }