クラス PropertyPath

java.lang.ObjectSE
org.springframework.data.mapping.PropertyPath
実装されたすべてのインターフェース:
IterableSE<PropertyPath>SupplierSE<StreamSE<PropertyPath>>Streamable<PropertyPath>

public class PropertyPath extends ObjectSE implements Streamable<PropertyPath>
ドメインクラスの PropertyPath の抽象化。
作成者:
Oliver Gierke, Christoph Strobl, Mark Paluch, Mariusz M ą czkowski, Johannes Englmeier
  • メソッドの詳細

    • getOwningType

      public TypeInformation<?> getOwningType()
      PropertyPath の所有型を返します。
      戻り値:
      owningType が null になることはありません。
    • getSegment

      public StringSE getSegment()
      PropertyPath の最初の部分を返します。例:
       PropertyPath.from("a.b.c", Some.class).getSegment();
       
      結果は a になります。
      戻り値:
      名前が null になることはありません。
    • getLeafProperty

      public PropertyPath getLeafProperty()
      PropertyPath のリーフプロパティを返します。
      戻り値:
      null になることはありません。
    • getLeafType

      public ClassSE<?> getLeafType()
      現在の PropertyPath のリーフプロパティの型を返します。
      戻り値:
      null になることはありません。
    • getType

      public ClassSE<?> getType()
      プロパティの実際の型を返します。単純なプロパティの単純な解決型、任意の IterableSE のコンポーネント型、または MapSE の値型を返します。
      戻り値:
      プロパティの実際の型。
    • getTypeInformation

      public TypeInformation<?> getTypeInformation()
    • next

      @Nullable public PropertyPath next()
      現在の要素の最初の要素を削除した結果の PropertyPath パスを返します。例:
       PropertyPath.from("a.b.c", Some.class).next().toDotPath();
       
      結果は出力になります: b.c
      戻り値:
      次のネストされた PropertyPath。ネストされた PropertyPath が使用できない場合は null。
      関連事項:
    • hasNext

      public boolean hasNext()
      ネストされた PropertyPath があるかどうかを返します。これが true を返す場合、next() が null 以外の値を返すことが期待できます。
      戻り値:
    • toDotPath

      public StringSE toDotPath()
      PropertyPath をドット表記で返します。
      戻り値:
      ドット表記の PropertyPath
    • isCollection

      public boolean isCollection()
      PropertyPath が実際にコレクションであるかどうかを返します。
      戻り値:
      PropertyPath が実際にコレクションであるかどうかを true にします。
    • nested

      public PropertyPath nested(StringSE path)
      現在のプロパティにネストされたパスの PropertyPath を返します。
      パラメーター:
      path - null または空であってはなりません。
      戻り値:
      null になることはありません。
    • iterator

      public IteratorSE<PropertyPath> iterator()
      同じリーフ型で長さが減少するすべての部分プロパティパスを反復する IteratorSE<PropertyPath> を返します。例:
       PropertyPath propertyPath = PropertyPath.from("a.b.c", Some.class);
       propertyPath.forEach(p -> p.toDotPath());
       
      結果はドットパスになります: *
       a.b.c
       b.c
       c
       
      次で指定:
      インターフェース IterableSE<PropertyPath>iterator 
    • equals

      public boolean equals(@Nullable ObjectSE o)
      オーバーライド:
      クラス ObjectSEequalsSE 
    • hashCode

      public int hashCode()
      オーバーライド:
      クラス ObjectSEhashCode 
    • from

      public static PropertyPath from(StringSE source, ClassSE<?> type)
      指定されたソース StringSE および TypeInformation から PropertyPath チェーン を抽出します。
      デフォルトでは SPLITTER を使用し、quotedSE リテラルには SPLITTER_FOR_QUOTED を使用します。

      パスの個別の部分は、".""_"、キャメルケースによって分離できます。プロパティとの一致があいまいな場合は、より長いプロパティ名が優先されます。"userAddressCity" の場合は、"user.address.city" よりも "userAddress.city" という解釈が優先されます。

      パラメーター:
      source - プロパティのパスを示す文字列。null であってはなりません。
      type - プロパティパスの所有型は null であってはなりません。
      戻り値:
      新しい PropertyPath は null ではないことが保証されます。
    • from

      public static PropertyPath from(StringSE source, TypeInformation<?> type)
      指定されたソース StringSE および TypeInformation から PropertyPath チェーン を抽出します。
      デフォルトでは SPLITTER を使用し、quotedSE リテラルには SPLITTER_FOR_QUOTED を使用します。

      パスの個別の部分は、".""_"、キャメルケースによって分離できます。プロパティとの一致があいまいな場合は、より長いプロパティ名が優先されます。"userAddressCity" の場合は、"user.address.city" よりも "userAddress.city" という解釈が優先されます。

      パラメーター:
      source - プロパティのパスを示す文字列。null であってはなりません。
      type - プロパティパスの所有型は null であってはなりません。
      戻り値:
      新しい PropertyPath は null ではないことが保証されます。
    • toString

      public StringSE toString()
      オーバーライド:
      クラス ObjectSEtoString