org.at4j.archive.builder
Interface ArchiveEntrySettings<T extends ArchiveEntrySettings<T>>

All Superinterfaces:
Cloneable
All Known Implementing Classes:
TarEntrySettings, ZipEntrySettings

public interface ArchiveEntrySettings<T extends ArchiveEntrySettings<T>>
extends Cloneable

This interface defines the settings for an entry that is being added to an archive. It does not specify what settings, or properties, there are – that is archive type-dependent – only the common operations for all settings objects.

Every property in a settings object have two states. It can either be set (i.e: non-null), or not set (i.e: null).

Different settings objects can be combined using the combineWith(ArchiveEntrySettings) method. That is used a lot by ArchiveBuilder:s.

Since:
1.0
Author:
Karl Gustafsson

Method Summary
 T clone()
          Clone this settings object.
 T combineWith(T settings)
          Create a new settings object that contains this object's settings combined with the settings from the supplied object.
 T setReadOnly()
          Set this settings object to be read only to prevent accidental modification.
 

Method Detail

combineWith

T combineWith(T settings)
Create a new settings object that contains this object's settings combined with the settings from the supplied object.

The returned object is created by first cloning this object, and then by replacing all the property values for properties that are set in the supplied object with the values from that object. In other words, properties from the supplied object take precedence over properties from this object.

Parameters:
settings - The other settings object.
Returns:
A new settings object with the settings from this object combined with the settings from the supplied object.

setReadOnly

T setReadOnly()
Set this settings object to be read only to prevent accidental modification.

After calling this method, a call to any of the object's setter methods will result in an IllegalStateException.

This method can safely be called several times.

Returns:
this.

clone

T clone()
Clone this settings object.

Returns:
A clone of this settings object.