パッケージ org.springframework.ui

クラス ConcurrentModel

実装されたすべてのインターフェース:
SerializableSEConcurrentMapSE<StringSE,ObjectSE>MapSE<StringSE,ObjectSE>Model
既知の直属サブクラス
BindingAwareConcurrentModel

public class ConcurrentModel extends ConcurrentHashMapSE<StringSE,ObjectSE> implements Model
同時シナリオで使用するための ConcurrentHashMapSE に基づく Model インターフェースの実装。

Spring WebFlux により、通常 Model インターフェースの宣言を介してハンドラーメソッドに公開されます。通常、ユーザーコード内で作成する必要はありません。必要に応じて、ハンドラーメソッドは、事前に決定されたモデルに対して通常の java.util.Map、おそらく java.util.ConcurrentMap を返すことができます。

導入:
5.0
作成者:
Rossen Stoyanchev
関連事項:
  • コンストラクターの詳細

    • ConcurrentModel

      public ConcurrentModel()
      新しい空の ConcurrentModel を作成します。
    • ConcurrentModel

      public ConcurrentModel(StringSE attributeName, ObjectSE attributeValue)
      指定された名前で指定された属性を含む新しい ModelMap を構築します。
      関連事項:
    • ConcurrentModel

      public ConcurrentModel(ObjectSE attributeValue)
      指定された属性を含む新しい ModelMap を作成します。属性名の生成を使用して、提供されたモデルオブジェクトのキーを生成します。
      関連事項:
  • メソッドの詳細

    • put

      @Nullable public ObjectSE put(StringSE key, @Nullable ObjectSE value)
      次で指定:
      インターフェース MapSE<StringSE,ObjectSE>putSE 
      オーバーライド:
      クラス ConcurrentHashMapSE<StringSE,ObjectSE>putSE 
    • putAll

      public void putAll(MapSE<? extends StringSE,?> map)
      次で指定:
      インターフェース MapSE<StringSE,ObjectSE>putAllSE 
      オーバーライド:
      クラス ConcurrentHashMapSE<StringSE,ObjectSE>putAllSE 
    • addAttribute

      public ConcurrentModel addAttribute(StringSE attributeName, @Nullable ObjectSE attributeValue)
      指定された名前に指定された属性を追加します。
      次で指定:
      インターフェース ModeladdAttribute 
      パラメーター:
      attributeName - モデル属性の名前 (非 null)
      attributeValue - モデル属性値 (null の場合は無視され、既存のエントリがあれば削除されます)
    • addAttribute

      public ConcurrentModel addAttribute(ObjectSE attributeValue)
      generated name を使用して、この Map に提供された属性を追加します。

      メモ: 真の規則名を正しく判別できないため、このメソッドを使用する場合、空の CollectionsSE はモデルに追加されません。ビューコードは、JSTL タグによってすでに行われているように、空のコレクションではなく null をチェックする必要があります。

      次で指定:
      インターフェース ModeladdAttribute 
      パラメーター:
      attributeValue - モデル属性値 (非 null)
    • addAllAttributes

      public ConcurrentModel addAllAttributes(@Nullable CollectionSE<?> attributeValues)
      各要素の属性名の生成を使用して、提供された Collection のすべての属性をこの Map にコピーします。
      次で指定:
      インターフェース ModeladdAllAttributes 
      関連事項:
    • addAllAttributes

      public ConcurrentModel addAllAttributes(@Nullable MapSE<StringSE,?> attributes)
      指定された Map のすべての属性をこの Map にコピーします。
      次で指定:
      インターフェース ModeladdAllAttributes 
      関連事項:
    • mergeAttributes

      public ConcurrentModel mergeAttributes(@Nullable MapSE<StringSE,?> attributes)
      指定された Map のすべての属性をこの Map にコピーします。同じ名前の既存のオブジェクトが優先されます(つまり、置き換えられません)。
      次で指定:
      インターフェース ModelmergeAttributes 
    • containsAttribute

      public boolean containsAttribute(StringSE attributeName)
      このモデルには、指定された名前の属性が含まれているか判定します。
      次で指定:
      インターフェース ModelcontainsAttribute 
      パラメーター:
      attributeName - モデル属性の名前 (非 null)
      戻り値:
      このモデルに対応する属性が含まれているかどうか
    • getAttribute

      @Nullable public ObjectSE getAttribute(StringSE attributeName)
      インターフェースからコピーされた説明: Model
      指定された名前の属性値があれば、それを返します。
      次で指定:
      インターフェース ModelgetAttribute 
      パラメーター:
      attributeName - モデル属性の名前 (非 null)
      戻り値:
      対応する属性値、または存在しない場合は null 
    • asMap

      public MapSE<StringSE,ObjectSE> asMap()
      インターフェースからコピーされた説明: Model
      モデル属性の現在のセットをマップとして返します。
      次で指定:
      インターフェース ModelasMap