/** * Locates and returns the most specific {@link Kind.Adaptor} BaseEntry * subtype for this entry. If none can be found for the current class, * {@code null} will be returned. * * @throws Kind.AdaptorException for subclasses to throw. */ public BaseEntry<?> getAdaptedEntry() throws Kind.AdaptorException { BaseEntry<?> adaptedEntry = null; // Find the BaseEntry adaptor instance that is most specific. for (Kind.Adaptor adaptor : getAdaptors()) { if (!(adaptor instanceof BaseEntry)) { continue; } // If first matching adaptor or a narrower subtype of the current one, // then use it. if (adaptedEntry == null || adaptedEntry.getClass().isAssignableFrom(adaptor.getClass())) { adaptedEntry = (BaseEntry<?>) adaptor; } } return adaptedEntry; } }
/** * Locates and returns the most specific {@link Kind.Adaptor} BaseEntry * subtype for this entry. If none can be found for the current class, * {@code null} will be returned. * * @throws Kind.AdaptorException for subclasses to throw. */ public BaseEntry<?> getAdaptedEntry() throws Kind.AdaptorException { BaseEntry<?> adaptedEntry = null; // Find the BaseEntry adaptor instance that is most specific. for (Kind.Adaptor adaptor : getAdaptors()) { if (!(adaptor instanceof BaseEntry)) { continue; } // If first matching adaptor or a narrower subtype of the current one, // then use it. if (adaptedEntry == null || adaptedEntry.getClass().isAssignableFrom(adaptor.getClass())) { adaptedEntry = (BaseEntry<?>) adaptor; } } return adaptedEntry; } }
/** * Locates and returns the most specific {@link Kind.Adaptor} BaseEntry * subtype for this entry. If none can be found for the current class, * {@code null} will be returned. * * @throws Kind.AdaptorException for subclasses to throw. */ public BaseEntry<?> getAdaptedEntry() throws Kind.AdaptorException { BaseEntry<?> adaptedEntry = null; // Find the BaseEntry adaptor instance that is most specific. for (Kind.Adaptor adaptor : getAdaptors()) { if (!(adaptor instanceof BaseEntry)) { continue; } // If first matching adaptor or a narrower subtype of the current one, // then use it. if (adaptedEntry == null || adaptedEntry.getClass().isAssignableFrom(adaptor.getClass())) { adaptedEntry = (BaseEntry<?>) adaptor; } } return adaptedEntry; } }