Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
拡張できるインターフェイス、または実装クラスがデータ クラスでなければならないインターフェイスを作成する他の方法はありますか? copy() などのデータ クラス API メソッドにアクセスできると便利です。
いいえ、copyメソッドにはデータ クラスごとに一意の数のパラメーターがあるため、そのようなインターフェイスを使用しても意味がありません。すべてのデータ クラスに同じフィールドがある場合は、共通のインターフェイスを作成して実装するだけです。