TrueZIP Kernel 7.0-rc2

de.schlichtherle.truezip.util
Class Links

java.lang.Object
  extended by de.schlichtherle.truezip.util.Links

@ThreadSafe
public class Links
extends Object

Provides static utility methods for links.

Author:
Christian Schlichtherle

Constructor Summary
private Links()
           
 
Method Summary
static
<T> T
getTarget(Link<T> link)
          Returns the nullable target of the given link.
static
<T> Link<T>
newLink(Link.Type type, T target)
          Returns a nullable typed link to the given target.
static
<T> Link<T>
newLink(T target)
          Returns a nullable (strong) link to the given target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Links

private Links()
Method Detail

newLink

@CheckForNull
public static <T> Link<T> newLink(@CheckForNull
                                               T target)
Returns a nullable (strong) link to the given target. The returned link is null if and only if target is null.

Type Parameters:
T - The type of the target.
Parameters:
target - the nullable target.
Returns:
A nullable (strong) link to the given target.

newLink

@CheckForNull
public static <T> Link<T> newLink(@NonNull
                                               Link.Type type,
                                               @CheckForNull
                                               T target)
Returns a nullable typed link to the given target. The returned typed link is null if and only if target is null.

Type Parameters:
T - The type of the target.
Parameters:
target - the nullable target.
Returns:
A nullable typed link to the given target.

getTarget

@CheckForNull
public static <T> T getTarget(@CheckForNull
                                           Link<T> link)
Returns the nullable target of the given link. The returned target is null if and only if either the given link is null or its target is null.

Type Parameters:
T - The type of the target.
Parameters:
link - a nullable link.
Returns:
The nullable target of the given link.

TrueZIP Kernel 7.0-rc2

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.