congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Converters.secondsToTimeUnit
Code IndexAdd Tabnine to your IDE (free)

How to use
secondsToTimeUnit
method
in
org.springframework.data.redis.connection.convert.Converters

Best Java code snippets using org.springframework.data.redis.connection.convert.Converters.secondsToTimeUnit (Showing top 12 results out of 315)

origin: spring-projects/spring-data-redis

/**
 * Creates a new {@link Converter} to convert from seconds to the given {@link TimeUnit}.
 *
 * @param timeUnit muist not be {@literal null}.
 * @return
 * @since 1.8
 */
public static Converter<Long, Long> secondsToTimeUnit(final TimeUnit timeUnit) {
  return seconds -> secondsToTimeUnit(seconds, timeUnit);
}
origin: spring-projects/spring-data-redis

@Override
public Long ttl(byte[] key, TimeUnit timeUnit) {
  Assert.notNull(key, "Key must not be null!");
  try {
    return Converters.secondsToTimeUnit(connection.getCluster().ttl(key), timeUnit);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}
origin: spring-projects/spring-data-redis

@Override
public Long ttl(byte[] key, TimeUnit timeUnit) {
  Assert.notNull(key, "Key must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newLettuceResult(getAsyncConnection().ttl(key), Converters.secondsToTimeUnit(timeUnit)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newLettuceResult(getAsyncConnection().ttl(key), Converters.secondsToTimeUnit(timeUnit)));
      return null;
    }
    return Converters.secondsToTimeUnit(getConnection().ttl(key), timeUnit);
  } catch (Exception ex) {
    throw convertLettuceAccessException(ex);
  }
}
origin: spring-projects/spring-data-redis

@Override
public Long ttl(byte[] key, TimeUnit timeUnit) {
  Assert.notNull(key, "Key must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().ttl(key),
          Converters.secondsToTimeUnit(timeUnit)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().ttl(key),
          Converters.secondsToTimeUnit(timeUnit)));
      return null;
    }
    return Converters.secondsToTimeUnit(connection.getJedis().ttl(key), timeUnit);
  } catch (Exception ex) {
    throw connection.convertJedisAccessException(ex);
  }
}
origin: org.springframework.data/spring-data-redis

/**
 * Creates a new {@link Converter} to convert from seconds to the given {@link TimeUnit}.
 *
 * @param timeUnit muist not be {@literal null}.
 * @return
 * @since 1.8
 */
public static Converter<Long, Long> secondsToTimeUnit(final TimeUnit timeUnit) {
  return seconds -> secondsToTimeUnit(seconds, timeUnit);
}
origin: apache/servicemix-bundles

/**
 * Creates a new {@link Converter} to convert from seconds to the given {@link TimeUnit}.
 *
 * @param timeUnit muist not be {@literal null}.
 * @return
 * @since 1.8
 */
public static Converter<Long, Long> secondsToTimeUnit(final TimeUnit timeUnit) {
  return seconds -> secondsToTimeUnit(seconds, timeUnit);
}
origin: apache/servicemix-bundles

@Override
public Long ttl(byte[] key, TimeUnit timeUnit) {
  Assert.notNull(key, "Key must not be null!");
  try {
    return Converters.secondsToTimeUnit(connection.getCluster().ttl(key), timeUnit);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}
origin: org.springframework.data/spring-data-redis

@Override
public Long ttl(byte[] key, TimeUnit timeUnit) {
  Assert.notNull(key, "Key must not be null!");
  try {
    return Converters.secondsToTimeUnit(connection.getCluster().ttl(key), timeUnit);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}
origin: org.springframework.data/spring-data-redis

@Override
public Long ttl(byte[] key, TimeUnit timeUnit) {
  Assert.notNull(key, "Key must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newLettuceResult(getAsyncConnection().ttl(key), Converters.secondsToTimeUnit(timeUnit)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newLettuceResult(getAsyncConnection().ttl(key), Converters.secondsToTimeUnit(timeUnit)));
      return null;
    }
    return Converters.secondsToTimeUnit(getConnection().ttl(key), timeUnit);
  } catch (Exception ex) {
    throw convertLettuceAccessException(ex);
  }
}
origin: org.springframework.data/spring-data-redis

@Override
public Long ttl(byte[] key, TimeUnit timeUnit) {
  Assert.notNull(key, "Key must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().ttl(key),
          Converters.secondsToTimeUnit(timeUnit)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().ttl(key),
          Converters.secondsToTimeUnit(timeUnit)));
      return null;
    }
    return Converters.secondsToTimeUnit(connection.getJedis().ttl(key), timeUnit);
  } catch (Exception ex) {
    throw connection.convertJedisAccessException(ex);
  }
}
origin: apache/servicemix-bundles

@Override
public Long ttl(byte[] key, TimeUnit timeUnit) {
  Assert.notNull(key, "Key must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newLettuceResult(getAsyncConnection().ttl(key), Converters.secondsToTimeUnit(timeUnit)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newLettuceResult(getAsyncConnection().ttl(key), Converters.secondsToTimeUnit(timeUnit)));
      return null;
    }
    return Converters.secondsToTimeUnit(getConnection().ttl(key), timeUnit);
  } catch (Exception ex) {
    throw convertLettuceAccessException(ex);
  }
}
origin: apache/servicemix-bundles

@Override
public Long ttl(byte[] key, TimeUnit timeUnit) {
  Assert.notNull(key, "Key must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().ttl(key),
          Converters.secondsToTimeUnit(timeUnit)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().ttl(key),
          Converters.secondsToTimeUnit(timeUnit)));
      return null;
    }
    return Converters.secondsToTimeUnit(connection.getJedis().ttl(key), timeUnit);
  } catch (Exception ex) {
    throw connection.convertJedisAccessException(ex);
  }
}
org.springframework.data.redis.connection.convertConverterssecondsToTimeUnit

Javadoc

Converts seconds to the given TimeUnit.

Popular methods of Converters

  • toProperties
  • deserializingGeoResultsConverter
    Converter capable of deserializing GeoResults.
  • listToPropertiesConverter
    Returns a converter to convert array outputs with key-value sequences (such as produced by CONFIG GE
  • mapToPropertiesConverter
    Returns a converter to convert from Map to Properties.
  • millisecondsToTimeUnit
    Creates a new Converter to convert from milliseconds to the given TimeUnit.
  • secondsToDuration
    Convert the given nullable seconds to a Duration or null.
  • stringToBoolean
  • stringToBooleanConverter
  • toClusterNode
    Converts the result of a single line of CLUSTER NODES into a RedisClusterNode.
  • toSetOfRedisClusterNodes
    Converts lines from the result of CLUSTER NODES into RedisClusterNodes.
  • toTimeMillis
    Returns the timestamp constructed from the given seconds and microseconds.
  • toTimeMillis

Popular in Java

  • Reactive rest calls using spring rest template
  • putExtra (Intent)
  • runOnUiThread (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Collectors (java.util.stream)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now