Package alexiil.mc.lib.attributes
Interface Convertible
- All Known Subinterfaces:
- FixedFluidInv,- FixedFluidInvView,- FixedItemInv,- FixedItemInv.CopyingFixedItemInv,- FixedItemInv.ModifiableFixedItemInv,- FixedItemInvView,- LimitedFixedFluidInv,- LimitedFixedItemInv
- All Known Implementing Classes:
- AbstractPartialFixedFluidInvView,- AbstractPartialFixedItemInvView,- CombinedFixedFluidInv,- CombinedFixedFluidInvView,- CombinedFixedItemInv,- CombinedFixedItemInv.OfCopying,- CombinedFixedItemInv.OfModifiable,- CombinedFixedItemInvView,- DelegatingFixedFluidInv,- DelegatingFixedItemInv,- DelegatingFixedItemInv.OfCopying,- DelegatingFixedItemInv.OfModifiable,- DirectFixedItemInv,- EmptyFixedFluidInv,- EmptyFixedItemInv,- FixedInventoryVanillaWrapper,- FixedInventoryViewVanillaWrapper,- FixedSidedInventoryVanillaWrapper,- FullFixedItemInv,- JumboFixedFluidInv,- MappedFixedFluidInv,- MappedFixedFluidInvView,- MappedFixedItemInv,- MappedFixedItemInv.OfCopying,- MappedFixedItemInv.OfModifiable,- MappedFixedItemInvView,- SimpleFixedFluidInv,- SimpleFixedItemInv,- SimpleLimitedFixedFluidInv,- SimpleLimitedFixedItemInv,- SimpleLimitedFixedItemInv.OfCopying,- SimpleLimitedFixedItemInv.OfModifiable,- SlotFixedItemInv,- SubFixedFluidInv,- SubFixedFluidInvView,- SubFixedItemInv,- SubFixedItemInv.OfCopying,- SubFixedItemInv.OfModifiable,- SubFixedItemInvView
public interface Convertible
Simple interface for converting this object into another 
Class. It is always a good idea to check to see if
 this object is an instance of the desired class before calling convertTo(Class), because it is not required
 that it return itself.
 It is highly recommended that all objects which can be converted to are both documented in the class header, and exposed through a public "getter" method.
 It is generally intended that converted instances (which do not just extend the base type, but instead convert to a
 completely different type) implement OpenWrapper to return this object. 
 For example FixedItemInv can be converted to GroupedItemInv (by default returning a
 GroupedItemInvFixedWrapper) which returns the original FixedItemInv from
 OpenWrapper.getWrapped().
- 
Method SummaryModifier and TypeMethodDescription<T> TAttempts to provide a variant of this in the given class form.static <T> THelper method for testing if the object is already an instance of the given class (if so returning it immediately), or if it is an instance ofConvertible(if so returningconvertTo(Class)), otherwise returning null.static <T> TA helper method forconvertTo(Class)to quickly write implementations that only return a single other objectstatic <T> TA helper method forconvertTo(Class)to quickly write implementations that return any of a few predefined objects.
- 
Method Details- 
convertToAttempts to provide a variant of this in the given class form. This does not have to return "this" object if this is already an instance of the given class.Note: In order to be typesafe (and prevent crashes) it is recommended that you return Class.cast(Object)with the object you wish to return rather than just blindly cast to "T".
- 
offerA helper method forconvertTo(Class)to quickly write implementations that only return a single other object
- 
offerA helper method forconvertTo(Class)to quickly write implementations that return any of a few predefined objects.
- 
getAsHelper method for testing if the object is already an instance of the given class (if so returning it immediately), or if it is an instance ofConvertible(if so returningconvertTo(Class)), otherwise returning null.
 
-