クラス Converters

java.lang.ObjectSE
org.springframework.data.redis.connection.convert.Converters
既知の直属サブクラス
LettuceConverters

public abstract class Converters extends ObjectSE
一般的な型コンバーター。
作成者:
Jennifer Hickey, Thomas Darimont, Mark Paluch, Christoph Strobl, daihuabin, John Blum, Sorokin Evgeniy
  • コンストラクターの詳細

    • Converters

      public Converters()
  • メソッドの詳細

    • identityConverter

      public static <T> Converter<T,T> identityConverter()
      常に入力引数を返す Converter を返します。
      型パラメーター:
      T - 関数への入力および出力オブジェクトの型
      戻り値:
      常に入力引数を返す関数
      導入:
      2.5
    • stringToBoolean

      public static BooleanSE stringToBoolean(StringSE source)
    • stringToBooleanConverter

      public static Converter<StringSE,BooleanSE> stringToBooleanConverter()
    • stringToProps

      public static Converter<StringSE,PropertiesSE> stringToProps()
    • longToBoolean

      public static Converter<LongSE,BooleanSE> longToBoolean()
    • stringToDataType

      public static Converter<StringSE,DataType> stringToDataType()
    • toProperties

      public static PropertiesSE toProperties(StringSE source)
    • toProperties

      public static PropertiesSE toProperties(MapSE<?,?> source)
    • toBoolean

      public static BooleanSE toBoolean(@Nullable LongSE source)
    • toDataType

      public static DataType toDataType(StringSE source)
    • toBit

      public static byte[] toBit(BooleanSE source)
    • toClusterNode

      protected static RedisClusterNode toClusterNode(StringSE clusterNodesLine)
      CLUSTER NODES の 1 行の結果を RedisClusterNode に変換します。
      パラメーター:
      clusterNodesLine -
      戻り値:
      導入:
      1.7
    • toSetOfRedisClusterNodes

      public static SetSE<RedisClusterNode> toSetOfRedisClusterNodes(CollectionSE<StringSE> lines)
      CLUSTER NODES の結果から RedisClusterNode に行を変換します。
      パラメーター:
      lines -
      戻り値:
      導入:
      1.7
    • toSetOfRedisClusterNodes

      public static SetSE<RedisClusterNode> toSetOfRedisClusterNodes(StringSE clusterNodes)
      CLUSTER NODES の結果を RedisClusterNode に変換します。
      パラメーター:
      clusterNodes -
      戻り値:
      導入:
      1.7
    • toObjects

      public static ListSE<ObjectSE> toObjects(SetSE<Tuple> tuples)
    • toTimeMillis

      public static LongSE toTimeMillis(StringSE seconds, StringSE microseconds)
      指定された seconds および microseconds から構築されたタイムスタンプを返します。
      パラメーター:
      seconds - サーバー時間 (秒)
      microseconds - 現在の秒で経過したマイクロ秒
      戻り値:
    • toTimeMillis

      public static LongSE toTimeMillis(StringSE seconds, StringSE microseconds, TimeUnitSE unit)
      指定された seconds および microseconds から構築されたタイムスタンプを返します。
      パラメーター:
      seconds - 秒単位のサーバー時間。
      microseconds - 現在の秒で経過したマイクロ秒。
      unit - ターゲットユニット。
      戻り値:
      導入:
      2.5
    • secondsToTimeUnit

      public static long secondsToTimeUnit(long seconds, TimeUnitSE targetUnit)
      seconds を指定された TimeUnitSE に変換します。
      パラメーター:
      seconds -
      targetUnit - null であってはなりません。
      戻り値:
      導入:
      1.8
    • secondsToTimeUnit

      public static Converter<LongSE,LongSE> secondsToTimeUnit(TimeUnitSE timeUnit)
      秒から指定された TimeUnitSE に変換する新しい Converter を作成します。
      パラメーター:
      timeUnit - muist は null ではありません。
      戻り値:
      導入:
      1.8
    • millisecondsToTimeUnit

      public static long millisecondsToTimeUnit(long milliseconds, TimeUnitSE targetUnit)
      milliseconds を指定された TimeUnitSE に変換します。
      パラメーター:
      milliseconds -
      targetUnit - null であってはなりません。
      戻り値:
      導入:
      1.8
    • millisecondsToTimeUnit

      public static Converter<LongSE,LongSE> millisecondsToTimeUnit(TimeUnitSE timeUnit)
      ミリ秒から指定された TimeUnitSE に変換する新しい Converter を作成します。
      パラメーター:
      timeUnit - null であってはなりません。
      戻り値:
      導入:
      1.8
    • deserializingGeoResultsConverter

      public static <V> Converter<GeoResults<RedisGeoCommands.GeoLocation<byte[]>>,GeoResults<RedisGeoCommands.GeoLocation<V>>> deserializingGeoResultsConverter(RedisSerializer<V> serializer)
      GeoResults を逆直列化できる Converter
      パラメーター:
      serializer -
      戻り値:
      導入:
      1.8
    • distanceConverterForMetric

      public static Converter<DoubleSE,Distance> distanceConverterForMetric(Metric metric)
      指定された Metric を使用して Double を Distance に変換できる Converter
      パラメーター:
      metric -
      戻り値:
      導入:
      1.8
    • toProperties

      public static PropertiesSE toProperties(ListSE<StringSE> input)
      ListSE から PropertiesSE に ( CONFIG GET によって生成されたような) キー値シーケンスを持つ配列出力を変換します。
      パラメーター:
      input - null であってはなりません。
      戻り値:
      マップされた結果。
      導入:
      2.0
    • listToPropertiesConverter

      public static Converter<ListSE<StringSE>,PropertiesSE> listToPropertiesConverter()
      ListSE から PropertiesSE にキーと値のシーケンス ( CONFIG GET によって生成されたものなど) を含む配列出力を変換するコンバーターを返します。
      戻り値:
      コンバーター。
      導入:
      2.0
    • mapToPropertiesConverter

      public static <K, V> Converter<MapSE<K,V>,PropertiesSE> mapToPropertiesConverter()
      MapSE から PropertiesSE に変換するコンバーターを返します。
      戻り値:
      コンバーター。
      導入:
      2.0
    • secondsToDuration

      @Nullable public static DurationSE secondsToDuration(@Nullable LongSE seconds)
      指定された null 許容秒を DurationSE または null に変換します。
      パラメーター:
      seconds - null でもかまいません。
      戻り値:
      DurationSE または null として指定された秒。
      導入:
      2.1
    • parse

      public static <T> T parse(ObjectSE source, ClassSE<T> targetType)
      byte[] と ByteBufferSE のベストエフォート変換を適用して、何かのリストなどのかなり一般的な Redis レスポンスを意味のある構造に解析します。
      型パラメーター:
      T -
      パラメーター:
      source - 解析するソース
      targetType - 例: MapSEStringSE、...
      戻り値:
      導入:
      2.3
    • parse

      public static ObjectSE parse(ObjectSE source, StringSE sourcePath, MapSE<StringSE,ClassSE<?>> typeHintMap)
      sourcePath と typeHintMap に基づいて byte[] と ByteBufferSE のベストエフォート変換を適用して、何かのリストなどのかなり一般的な Redis レスポンスを意味のある構造に解析します。
      パラメーター:
      source - 解析するソース
      sourcePath - 現在のパス (レベル 0 の場合は「ルート」を使用)。
      typeHintMap - ワイルドカード (*) を許可するターゲット型 ヒントへのソースパス。
      戻り値:
      導入:
      2.3
    • entryOf

      public static <K, V> Map.EntrySE<K,V> entryOf(@Nullable K key, @Nullable V value)
      key と value から Map.EntrySE を作成します。
      型パラメーター:
      K -
      V -
      パラメーター:
      key -
      value -
      戻り値:
      導入:
      2.6