Top Description Inners Fields Methods
org.eclipse.jgit.internal.util

public Interface Optionally<T>

Known Direct Implementers
org.eclipse.jgit.internal.util.Optionally.Empty, org.eclipse.jgit.internal.util.Optionally.Hard, org.eclipse.jgit.internal.util.Optionally.Soft
Type Parameters
<T>
type of the mutable optional object
Imports
java.lang.ref.SoftReference, java.util.Optional

Interface representing a reference to a potentially mutable optional object.
Since
6.7

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Optionally.Empty<
type of the mutable optional object
T
>

A permanently empty Optionally

public static class
Optionally.Hard<
type of the mutable optional object
T
>

A permanent(hard) reference to an object

public static class
Optionally.Soft<
type of the mutable optional object
T
>

A SoftReference Optionally

Field Summary

Modifier and TypeField and Description
public static final Optionally<?>
EMPTY

The empty Optionally

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Clear the object

public static <
type of the empty Optionally
T
>
Optionally<T>

Returns:

the empty Optionally
empty
()

Get empty Optionally

public Optional<T>

Returns:

the mutable optional object
getOptional
()

Get an Optional representing the current state of the object

Field Detail

EMPTYback to summary
public static final Optionally<?> EMPTY

The empty Optionally

Method Detail

clearback to summary
public void clear()

Clear the object

emptyback to summary
public static <T> Optionally<T> empty()

Get empty Optionally

Parameters
<T>
type of the empty Optionally
Returns:Optionally<T>

the empty Optionally

Annotations
@SuppressWarnings:unchecked
getOptionalback to summary
public Optional<T> getOptional()

Get an Optional representing the current state of the object

Returns:Optional<T>

the mutable optional object

org.eclipse.jgit.internal.util back to summary

public Class Optionally.Empty<T>

extends Object
implements Optionally<T>
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.internal.util.Optionally
Type Parameters
<T>
type of the mutable optional object

A permanently empty Optionally

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public Optional<T>
getOptional()

Implements org.eclipse.jgit.internal.util.Optionally.getOptional.

Get an Optional representing the current state of the object

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Emptyback to summary
public Empty()

Method Detail

clearback to summary
public void clear()

Implements org.eclipse.jgit.internal.util.Optionally.clear.

Doc from org.eclipse.jgit.internal.util.Optionally.clear.

Clear the object

Annotations
@Override
getOptionalback to summary
public Optional<T> getOptional()

Implements org.eclipse.jgit.internal.util.Optionally.getOptional.

Doc from org.eclipse.jgit.internal.util.Optionally.getOptional.

Get an Optional representing the current state of the object

Returns:Optional<T>

the mutable optional object

Annotations
@Override
org.eclipse.jgit.internal.util back to summary

public Class Optionally.Hard<T>

extends Object
implements Optionally<T>
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.internal.util.Optionally
Type Parameters
<T>
type of the mutable optional object

A permanent(hard) reference to an object

Field Summary

Modifier and TypeField and Description
protected Optional<T>
optional

The mutable optional object

Constructor Summary

AccessConstructor and Description
public
Hard(T
the mutable optional object
element
)

Method Summary

Modifier and TypeMethod and Description
public void
public Optional<T>
getOptional()

Implements org.eclipse.jgit.internal.util.Optionally.getOptional.

Get an Optional representing the current state of the object

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

optionalback to summary
protected Optional<T> optional

The mutable optional object

Constructor Detail

Hardback to summary
public Hard(T element)
Parameters
element:T

the mutable optional object

Method Detail

clearback to summary
public void clear()

Implements org.eclipse.jgit.internal.util.Optionally.clear.

Doc from org.eclipse.jgit.internal.util.Optionally.clear.

Clear the object

Annotations
@Override
getOptionalback to summary
public Optional<T> getOptional()

Implements org.eclipse.jgit.internal.util.Optionally.getOptional.

Doc from org.eclipse.jgit.internal.util.Optionally.getOptional.

Get an Optional representing the current state of the object

Returns:Optional<T>

the mutable optional object

Annotations
@Override
org.eclipse.jgit.internal.util back to summary

public Class Optionally.Soft<T>

extends SoftReference<T>
implements Optionally<T>
Class Inheritance
All Implemented Interfaces
org.eclipse.jgit.internal.util.Optionally
Type Parameters
<T>
type of the mutable optional object

A SoftReference Optionally

Constructor Summary

AccessConstructor and Description
public
Soft(T
the mutable optional object
t
)

Method Summary

Modifier and TypeMethod and Description
public Optional<T>
getOptional()

Implements org.eclipse.jgit.internal.util.Optionally.getOptional.

Get an Optional representing the current state of the object

Inherited from java.lang.ref.SoftReference:
get

Constructor Detail

Softback to summary
public Soft(T t)
Parameters
t:T

the mutable optional object

Method Detail

getOptionalback to summary
public Optional<T> getOptional()

Implements org.eclipse.jgit.internal.util.Optionally.getOptional.

Doc from org.eclipse.jgit.internal.util.Optionally.getOptional.

Get an Optional representing the current state of the object

Returns:Optional<T>

the mutable optional object

Annotations
@Override