Пример #1
0
 public override T getAttribute <T>(AttributeType <T> type)
 {
     return(findAttribute(type).orElseThrow(() => new System.ArgumentException(Messages.format("Attribute not found for type '{}'", type))));
 }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Override @SuppressWarnings("unchecked") public <T> java.util.Optional<T> findAttribute(AttributeType<T> type)
        public Optional <T> findAttribute <T>(AttributeType <T> type)
        {
            return(Optional.ofNullable((T)attributes.get(type)));
        }