java.module
Class ModuleArchiveInfo

java.lang.Object
  extended by java.module.ModuleArchiveInfo

public class ModuleArchiveInfo
extends Object

This class represents the information of an installed module archive in the repository.

Since:
1.7
Author:
Dave Bristor, Stanley M. Ho
See Also:
Repository, Version

Constructor Summary
ModuleArchiveInfo(String name, Version version, String platform, String arch, String fileName, long lastModified)
          Constructs a new ModuleArchiveInfo instance.
 
Method Summary
 boolean equals(Object other)
          Compare two ModuleArchiveInfo objects for equality.
 String getArchitecture()
          Returns the name of the architecture of the module definition in the module archive.
 String getFileName()
          Returns the filename of the module archive.
 long getLastModified()
          Returns the last modified time of the module archive in the repository.
 String getName()
          Returns the name of the module definition in the module archive.
 String getPlatform()
          Returns the name of the platform of the module definition in the module archive.
 Version getVersion()
          Returns the version of the module definition in the module archive.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleArchiveInfo

public ModuleArchiveInfo(String name,
                         Version version,
                         String platform,
                         String arch,
                         String fileName,
                         long lastModified)
Constructs a new ModuleArchiveInfo instance.

Parameters:
name - the name of the module definition in the module archive.
version - the version of the module definition in the module archive.
platform - the platform of the module definition in the module archive.
arch - the architecture of the module definition in the module archive.
fileName - the filename of the module archive.
lastModified - the last modified time of the module archive.
Throws:
NullPointerException - if name is null, or version is null. It is also thrown if platform or archive is provided, they are not provided together, or if the last modified time is less than 0.
Method Detail

getName

public String getName()
Returns the name of the module definition in the module archive.

Returns:
the name of the module definition.

getVersion

public Version getVersion()
Returns the version of the module definition in the module archive.

Returns:
the version of the module definition.

getPlatform

public String getPlatform()
Returns the name of the platform of the module definition in the module archive. The value should be one of the possible values of the system property "os.platform".

Returns:
the name of the platform. If the module definition has no platform binding, returns null.

getArchitecture

public String getArchitecture()
Returns the name of the architecture of the module definition in the module archive. The value should be one of the possible values of the system property "os.arch".

Returns:
the name of the architecture. If the module definition has no platform binding, returns null.

getFileName

public String getFileName()
Returns the filename of the module archive.

Returns:
the filename of the module archive. If the module archive does not have a filename, return null.

getLastModified

public long getLastModified()
Returns the last modified time of the module archive in the repository. The result is the number of milliseconds since January 1, 1970 GMT.

Returns:
the time the module archive was last modified, or 0 if not known.

equals

public boolean equals(Object other)
Compare two ModuleArchiveInfo objects for equality. The result is true if and only if the argument is not null and is a ModuleArchiveInfo object that is the same instance as this ModuleArchiveInfo.

Overrides:
equals in class Object
Parameters:
other - the object to compare with.
Returns:
whether or not the two objects are equal.

hashCode

public int hashCode()
Overrides:
hashCode in class Object