org.netbeans.modules.j2eeserver/4 1.89.0 1

org.netbeans.modules.j2ee.deployment.plugins.api
Class ServerLibraryDependency

java.lang.Object
  extended by org.netbeans.modules.j2ee.deployment.plugins.api.ServerLibraryDependency

public final class ServerLibraryDependency
extends Object

Represents the library dependency. For example library version required by the enterprise module.

Since:
1.68

Method Summary
 boolean equals(Object obj)
           
static ServerLibraryDependency exactVersion(String name, Version specificationVersion, Version implementationVersion)
          Creates the library dependency which specifies the exact specification and implementation version.
 Version getImplementationVersion()
          Returns the implementation version.
 String getName()
          Returns the name of the required library.
 Version getSpecificationVersion()
          Returns the specification version.
 int hashCode()
           
 boolean isExactMatch()
          Returns true if the exactly the same version are required by the dependency to match the library.
static ServerLibraryDependency minimalVersion(String name, Version specificationVersion, Version implementationVersion)
          Creates the library dependency which specifies the minimal specification and implementation version.
 boolean specificationEquals(Object obj)
          Returns true if the other object is library dependency and both name and specification version are equal to name and specification version of this object.
 boolean versionMatches(ServerLibrary library)
          Returns true if the given library matches the dependency.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

minimalVersion

public static ServerLibraryDependency minimalVersion(@NonNull
                                                     String name,
                                                     @NullAllowed
                                                     Version specificationVersion,
                                                     @NullAllowed
                                                     Version implementationVersion)
Creates the library dependency which specifies the minimal specification and implementation version.

When both specification and implementation version is null it has the meaning of any version.

Parameters:
name - name of the library
specificationVersion - the minimal specification version, may be null
implementationVersion - the minimal implementation version, may be null
Returns:
the library dependency which specifies the minimal specification and implementation version

exactVersion

public static ServerLibraryDependency exactVersion(@NonNull
                                                   String name,
                                                   @NullAllowed
                                                   Version specificationVersion,
                                                   @NullAllowed
                                                   Version implementationVersion)
Creates the library dependency which specifies the exact specification and implementation version.

Parameters:
name - name of the library
specificationVersion - the minimal specification version, may be null
implementationVersion - the minimal implementation version, may be null
Returns:
the library dependency which specifies the exact specification and implementation version

versionMatches

public boolean versionMatches(@NonNull
                              ServerLibrary library)
Returns true if the given library matches the dependency.

The library matches the dependency if the dependency specify the minimal versions (specification and/or implementation) and corresponding versions of the library are equal or greater. If the dependency specify the exact version the corresponding versions of library must be the same as those specified for dependency.

Parameters:
library - the library to check
Returns:
true if the given library matches the dependency
See Also:
Version.isAboveOrEqual(org.netbeans.modules.j2ee.deployment.common.api.Version), Version.isBelowOrEqual(org.netbeans.modules.j2ee.deployment.common.api.Version)

getName

@NonNull
public String getName()
Returns the name of the required library.

Returns:
the name of the required library

getSpecificationVersion

@CheckForNull
public Version getSpecificationVersion()
Returns the specification version. May be null.

Returns:
the specification version; may be null

getImplementationVersion

@CheckForNull
public Version getImplementationVersion()
Returns the implementation version. May be null.

Returns:
the implementation version; may be null

isExactMatch

public boolean isExactMatch()
Returns true if the exactly the same version are required by the dependency to match the library.

Returns:
true if the exactly the same version are required by the dependency to match the library

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

specificationEquals

public boolean specificationEquals(Object obj)
Returns true if the other object is library dependency and both name and specification version are equal to name and specification version of this object.

Parameters:
obj - object to test
Returns:
true if the other object is library dependency with same name and specification version as this object
Since:
1.77

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
equals(java.lang.Object)

org.netbeans.modules.j2eeserver/4 1.89.0 1

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.