com.backendless.hive.HiveKeyValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-sdk-common Show documentation
Show all versions of java-sdk-common Show documentation
Provides access to Backendless API
The newest version!
package com.backendless.hive;
import com.backendless.core.responder.AdaptingResponder;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
public final class HiveKeyValue extends HiveGeneralForKeyValue
{
public final static String HIVE_KEY_VALUE_ALIAS = "com.backendless.services.hive.HiveKeyValueService";
private final HiveGeneralWithoutStoreKey generalOps;
HiveKeyValue( String hiveName, HiveGeneralWithoutStoreKey generalOps )
{
super( hiveName, StoreType.KeyValue );
this.generalOps = generalOps;
}
public static final class Options
{
private int expirationSeconds = 0;
private Expiration expiration = Expiration.None;
private Condition condition = Condition.Always;
private Options()
{
}
public static Options create()
{
return new Options();
}
public Options expireAt( LocalDateTime localDateTime )
{
this.expiration = Expiration.UnixTimestamp;
this.expirationSeconds = (int) localDateTime.toEpochSecond( ZoneOffset.UTC );
return this;
}
public Options expireAt( int timeStampInSeconds )
{
this.expiration = Expiration.UnixTimestamp;
this.expirationSeconds = timeStampInSeconds;
return this;
}
public Options expireAfter( int seconds )
{
this.expiration = Expiration.TTL;
this.expirationSeconds = seconds;
return this;
}
public Options condition( Condition condition )
{
this.condition = condition;
return this;
}
}
public CompletableFuture get( String key )
{
return this.makeRemoteCall( "get", key )
.thenApply( HiveSerializer::deserialize );
}
public CompletableFuture
© 2015 - 2025 Weber Informatics LLC | Privacy Policy