package com.infinityraider.agricraft.api.adapter;
public interface IAgriAdapterRegistry<T> {
boolean hasAdapter(IAgriAdapter<T> adapter);
boolean hasAdapter(Object object);
<BUG>IAgriAdapter<T> getAdapter(Object obj);
</BUG>
boolean registerAdapter(IAgriAdapter<T> adapter);
boolean unregisterAdapter(IAgriAdapter<T> adapter);
<BUG>default T getValue(Object obj) {

IAgriAdapter<T> adapter = getAdapter(obj);
return adapter == null ? null : adapter.getValue(obj);</BUG>
}

package com.infinityraider.agricraft.api.adapter;
import java.util.Optional;
public interface IAgriAdapterRegistry<T> {
boolean hasAdapter(IAgriAdapter<T> adapter);
boolean hasAdapter(Object object);
Optional<IAgriAdapter<T>> getAdapter(Object obj);
boolean registerAdapter(IAgriAdapter<T> adapter);
boolean unregisterAdapter(IAgriAdapter<T> adapter);
default Optional<T> valueOf(Object obj) {
return getAdapter(obj).flatMap(a -> a.valueOf(obj));
