V
- Value type.public class GeoValue<V> extends Value<V>
Value
.Modifier | Constructor and Description |
---|---|
protected |
GeoValue()
Serializable constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static <T extends V,V> |
from(GeoCoordinates coordinates,
Optional<T> optional)
|
static <T extends V,V> |
fromNullable(GeoCoordinates coordinates,
T value)
|
GeoCoordinates |
getCoordinates() |
double |
getLatitude() |
double |
getLongitude() |
int |
hashCode() |
static <T extends V,V> |
just(double longitude,
double latitude,
T value)
|
static <T extends V,V> |
just(GeoCoordinates coordinates,
T value)
|
<R> GeoValue<R> |
map(Function<? super V,? extends R> mapper)
Returns a
GeoValue consisting of the results of applying the given function to the value of this element. |
GeoValue<V> |
mapCoordinates(Function<? super GeoCoordinates,? extends GeoCoordinates> mapper)
Returns a
GeoValue consisting of the results of applying the given function to the GeoCoordinates of this
element. |
String |
toString() |
empty, from, fromNullable, getValue, getValueOrElse, getValueOrElseGet, getValueOrElseThrow, hasValue, ifEmpty, ifHasValue, ifHasValueOrElse, isEmpty, just, optional, stream
public static <T extends V,V> Value<V> from(GeoCoordinates coordinates, Optional<T> optional)
Value
from a key
and an Optional
. The resulting value contains the value from the
Optional
if a value is present. Value is empty if the Optional
is empty.coordinates
- the score.optional
- the optional. May be empty but never null
.Value
.public static <T extends V,V> Value<V> fromNullable(GeoCoordinates coordinates, T value)
Value
from a coordinates
and value
. The resulting value contains the value if the
value
is not null.coordinates
- the coordinates.value
- the value. May be null
.Value
.public static <T extends V,V> GeoValue<V> just(double longitude, double latitude, T value)
longitude
- the longitude coordinate according to WGS84.latitude
- the latitude coordinate according to WGS84.value
- the value. Must not be null
.GeoValue
public static <T extends V,V> GeoValue<V> just(GeoCoordinates coordinates, T value)
coordinates
- the coordinates.value
- the value. Must not be null
.GeoValue
.public GeoCoordinates getCoordinates()
public double getLongitude()
Value.hasValue()
.NoSuchElementException
- if the value is not present.public double getLatitude()
Value.hasValue()
.NoSuchElementException
- if the value is not present.public <R> GeoValue<R> map(Function<? super V,? extends R> mapper)
GeoValue
consisting of the results of applying the given function to the value of this element. Mapping
is performed only if a value is present
.public GeoValue<V> mapCoordinates(Function<? super GeoCoordinates,? extends GeoCoordinates> mapper)
GeoValue
consisting of the results of applying the given function to the GeoCoordinates
of this
element. Mapping is performed only if a value is present
.mapper
- a stateless function to apply to each element.GeoValue
.Copyright © 2025 lettuce.io. All rights reserved.