import java.util.List; public class Description { String texte; Condition condition; String nom; public Description( String nom, String texte, Condition condition) { this.nom = nom; this.texte = texte; this.condition = condition; } @Override public String toString() { return this.texte; } public static Description search(List list, String name) { return list.stream().filter(o -> o.nom.equals(name)).findFirst() .orElseThrow(() -> new IllegalArgumentException("No data found")); } }