congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
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

  • Finding current android device location
  • getContentResolver (Context)
  • putExtra (Intent)
  • onRequestPermissionsResult (Fragment)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • JFrame (javax.swing)
  • JOptionPane (javax.swing)
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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