/** * Convenience method for looking up {@link TypeId}s from {@link EntityType}s. The * {@code applinks-entity-type} descriptor enforces that all registered {@link EntityType}s implement the * {@link IdentifiableType} interface, so the cast in the delegate method is safe. */ public static TypeId getTypeId(final EntityType type) { return get(type); }
public String apply(@Nullable EntityType from) { return TypeId.getTypeId(from).get(); } }));
@Override public String marshal(final TypeId v) throws Exception { return v.get(); } }
public String apply(@Nullable final EntityType from) { return TypeId.getTypeId(from).get(); } });
/** * Convenience method for looking up {@link TypeId}s from {@link ApplicationType}s. The * {@code applinks-application-type} descriptor enforces that all registered {@link ApplicationType}s implement the * {@link IdentifiableType} interface, so the cast in the delegate method is safe. */ public static TypeId getTypeId(final ApplicationType type) { return get(type); }
public String apply(@Nullable final EntityType from) { return TypeId.getTypeId(from).get(); } });
@Override public String marshal(final TypeId v) throws Exception { return v.get(); } }
public String apply(@Nullable EntityType from) { return TypeId.getTypeId(from).get(); } }));
private String key(final EntityLink entity) { return String.format("%s.%s.%s.%s", ENTITY_PREFIX, escape(entity.getApplicationLink().getId().get()), escape(getTypeId(entity.getType()).get()), escape(entity.getKey()) ); }
public ApplicationType loadApplicationType(final String typeClassName) { return typeCache.get(typeClassName); }
public int compareTo(final TypeId o) { return id.compareTo(o.get()); } }
@Nonnull protected String getIconKey() { return getId().get(); } }
public ApplicationOption(final ApplicationId id, final String name, final TypeId typeId, final String typeI18nKey, final boolean isUal, final String iconUri) { this.id = id.get(); this.name = name; this.typeId = typeId.get(); this.typeI18nKey = typeI18nKey; this.isUal = isUal; this.iconUri = iconUri; } }
@Nonnull protected String getIconKey() { return getId().get(); } }
private static String resolveAppType(ApplicationLink link) { final ApplicationType type = link.getType(); if (type instanceof IdentifiableType) { return IdentifiableType.class.cast(type).getId().get(); } else { return type.getClass().getName(); } }
@Nonnull @Override protected String getIconKey() { return isRebrandEnabled() ? "bitbucket" : getId().get(); }
public PropertySet getLocalEntityProperties(final String localEntityKey, final TypeId localEntityTypeId) { return getPropertySet(String.format("%s.%s.%s", LOCAL_ENTITY_PREFIX, escape(localEntityKey), escape(localEntityTypeId.get())) ); }
public int compare(final LinkAndAuthProviderEntity e1, final LinkAndAuthProviderEntity e2) { final int compareByType = e1.getApplication().getTypeId().get().compareTo(e2.getApplication().getTypeId().get()); if (compareByType != 0) { return compareByType; } else { //Compare by name return e1.getApplication().getName().compareTo(e2.getApplication().getName()); } } });