@Override public DescriptorType getDescriptorType() { return baseDescriptor.getDescriptorType(); }
@Override public DescriptorType getDescriptorType() { return baseDescriptor.getDescriptorType(); }
@Override public DescriptorType getDescriptorType() { return baseDescriptor.getDescriptorType(); }
@Override public DescriptorType getDescriptorType() { return baseDescriptor.getDescriptorType(); }
@Override public Filter getFilter() { final List<String> managedTypes = Lists.transform(contextDebugService.getManagedTypes(), Class::getName); return d -> d.getDescriptorType() == DescriptorType.CLASS && managedTypes.contains(d.getImplementation()); }
@Override public Filter getFilter() { final List<String> managedTypes = Lists.transform(contextDebugService.getManagedTypes(), Class::getName); return d -> d.getDescriptorType() == DescriptorType.CLASS && managedTypes.contains(d.getImplementation()); }
private ImplOnlyKey(Descriptor desc) { impl = desc.getImplementation(); type = desc.getDescriptorType(); hash = impl.hashCode() ^ type.hashCode(); }
private static void checkDescriptor(Descriptor d) { if (d == null) throw new IllegalArgumentException(); if (d.getImplementation() == null) throw new IllegalArgumentException(); if (d.getAdvertisedContracts() == null) throw new IllegalArgumentException(); if (d.getDescriptorType() == null) throw new IllegalArgumentException(); if (d.getDescriptorVisibility() == null) throw new IllegalArgumentException(); if (d.getMetadata() == null) throw new IllegalArgumentException(); if (d.getQualifiers() == null) throw new IllegalArgumentException(); }
private static void checkDescriptor(Descriptor d) { if (d == null) throw new IllegalArgumentException(); if (d.getImplementation() == null) throw new IllegalArgumentException(); if (d.getAdvertisedContracts() == null) throw new IllegalArgumentException(); if (d.getDescriptorType() == null) throw new IllegalArgumentException(); if (d.getDescriptorVisibility() == null) throw new IllegalArgumentException(); if (d.getMetadata() == null) throw new IllegalArgumentException(); if (d.getQualifiers() == null) throw new IllegalArgumentException(); }
private static void checkDescriptor(Descriptor d) { if (d == null) throw new IllegalArgumentException(); if (d.getImplementation() == null) throw new IllegalArgumentException(); if (d.getAdvertisedContracts() == null) throw new IllegalArgumentException(); if (d.getDescriptorType() == null) throw new IllegalArgumentException(); if (d.getDescriptorVisibility() == null) throw new IllegalArgumentException(); if (d.getMetadata() == null) throw new IllegalArgumentException(); if (d.getQualifiers() == null) throw new IllegalArgumentException(); }
private static void checkDescriptor(Descriptor d) { if (d == null) throw new IllegalArgumentException(); if (d.getImplementation() == null) throw new IllegalArgumentException(); if (d.getAdvertisedContracts() == null) throw new IllegalArgumentException(); if (d.getDescriptorType() == null) throw new IllegalArgumentException(); if (d.getDescriptorVisibility() == null) throw new IllegalArgumentException(); if (d.getMetadata() == null) throw new IllegalArgumentException(); if (d.getQualifiers() == null) throw new IllegalArgumentException(); }
/** * This creates a descriptor pair describing a {@link Factory} * and the associated {@link Factory#provide()} method * * @param asService A description of the factory itself as an hk2 service. * May not be null. Must have DescriptorType of {@link DescriptorType#CLASS}. One * of the contracts must be Factory * @param asProvideMethod A description of the provide method of the factory. Must have * DescriptorType of {@link DescriptorType#PROVIDE_METHOD}. * May not be null * @throws IllegalArgumentException if the descriptors are not of the proper type */ public FactoryDescriptorsImpl(Descriptor asService, Descriptor asProvideMethod) { if (asService == null || asProvideMethod == null) throw new IllegalArgumentException(); if (!DescriptorType.CLASS.equals(asService.getDescriptorType())) { throw new IllegalArgumentException("Creation of FactoryDescriptors must have first argument of type CLASS"); } if (!asService.getAdvertisedContracts().contains(Factory.class.getName())) { throw new IllegalArgumentException("Creation of FactoryDescriptors must have Factory as a contract of the first argument"); } if (!DescriptorType.PROVIDE_METHOD.equals(asProvideMethod.getDescriptorType())) { throw new IllegalArgumentException("Creation of FactoryDescriptors must have second argument of type PROVIDE_METHOD"); } this.asService = asService; this.asProvideMethod = asProvideMethod; }
/** * This creates a descriptor pair describing a {@link Factory} * and the associated {@link Factory#provide()} method * * @param asService A description of the factory itself as an hk2 service. * May not be null. Must have DescriptorType of {@link DescriptorType#CLASS}. One * of the contracts must be Factory * @param asProvideMethod A description of the provide method of the factory. Must have * DescriptorType of {@link DescriptorType#PROVIDE_METHOD}. * May not be null * @throws IllegalArgumentException if the descriptors are not of the proper type */ public FactoryDescriptorsImpl(Descriptor asService, Descriptor asProvideMethod) { if (asService == null || asProvideMethod == null) throw new IllegalArgumentException(); if (!DescriptorType.CLASS.equals(asService.getDescriptorType())) { throw new IllegalArgumentException("Creation of FactoryDescriptors must have first argument of type CLASS"); } if (!asService.getAdvertisedContracts().contains(Factory.class.getName())) { throw new IllegalArgumentException("Creation of FactoryDescriptors must have Factory as a contract of the first argument"); } if (!DescriptorType.PROVIDE_METHOD.equals(asProvideMethod.getDescriptorType())) { throw new IllegalArgumentException("Creation of FactoryDescriptors must have second argument of type PROVIDE_METHOD"); } this.asService = asService; this.asProvideMethod = asProvideMethod; }
/** * This creates a descriptor pair describing a {@link Factory} * and the associated {@link Factory#provide()} method * * @param asService A description of the factory itself as an hk2 service. * May not be null. Must have DescriptorType of {@link DescriptorType#CLASS}. One * of the contracts must be Factory * @param asProvideMethod A description of the provide method of the factory. Must have * DescriptorType of {@link DescriptorType#PROVIDE_METHOD}. * May not be null * @throws IllegalArgumentException if the descriptors are not of the proper type */ public FactoryDescriptorsImpl(Descriptor asService, Descriptor asProvideMethod) { if (asService == null || asProvideMethod == null) throw new IllegalArgumentException(); if (!DescriptorType.CLASS.equals(asService.getDescriptorType())) { throw new IllegalArgumentException("Creation of FactoryDescriptors must have first argument of type CLASS"); } if (!asService.getAdvertisedContracts().contains(Factory.class.getName())) { throw new IllegalArgumentException("Creation of FactoryDescriptors must have Factory as a contract of the first argument"); } if (!DescriptorType.PROVIDE_METHOD.equals(asProvideMethod.getDescriptorType())) { throw new IllegalArgumentException("Creation of FactoryDescriptors must have second argument of type PROVIDE_METHOD"); } this.asService = asService; this.asProvideMethod = asProvideMethod; }
@Override public boolean matches(Descriptor d) { if (d.getImplementation().equals(impl) && d.getDescriptorType().equals(descriptorImpl.getDescriptorType())) { return true; } return false; }
sb.append(ReflectionHelper.writeSet(d.getQualifiers())); sb.append("\n\tdescriptorType=" + d.getDescriptorType());
sb.append(ReflectionHelper.writeSet(d.getQualifiers())); sb.append("\n\tdescriptorType=" + d.getDescriptorType());
public boolean equals(Object a) { if (a == null) return false; if (!(a instanceof Descriptor)) return false; Descriptor d = (Descriptor) a; if (!GeneralUtilities.safeEquals(implementation, d.getImplementation())) return false; if (!equalOrderedCollection((contracts == null) ? EMPTY_CONTRACTS_SET : contracts, d.getAdvertisedContracts())) return false; if (!GeneralUtilities.safeEquals(name, d.getName())) return false; if (!GeneralUtilities.safeEquals(scope, d.getScope())) return false; if (!equalOrderedCollection((qualifiers == null) ? EMPTY_QUALIFIER_SET : qualifiers, d.getQualifiers())) return false; if (!GeneralUtilities.safeEquals(descriptorType, d.getDescriptorType())) return false; if (!GeneralUtilities.safeEquals(descriptorVisibility, d.getDescriptorVisibility())) return false; if (!equalMetadata((metadatas == null) ? EMPTY_METADATAS_MAP : metadatas, d.getMetadata())) return false; if (!GeneralUtilities.safeEquals(proxiable, d.isProxiable())) return false; if (!GeneralUtilities.safeEquals(proxyForSameScope, d.isProxyForSameScope())) return false; if (!GeneralUtilities.safeEquals(analysisName, d.getClassAnalysisName())) return false; return true; }
public boolean equals(Object a) { if (a == null) return false; if (!(a instanceof Descriptor)) return false; Descriptor d = (Descriptor) a; if (!GeneralUtilities.safeEquals(implementation, d.getImplementation())) return false; if (!equalOrderedCollection((contracts == null) ? EMPTY_CONTRACTS_SET : contracts, d.getAdvertisedContracts())) return false; if (!GeneralUtilities.safeEquals(name, d.getName())) return false; if (!GeneralUtilities.safeEquals(scope, d.getScope())) return false; if (!equalOrderedCollection((qualifiers == null) ? EMPTY_QUALIFIER_SET : qualifiers, d.getQualifiers())) return false; if (!GeneralUtilities.safeEquals(descriptorType, d.getDescriptorType())) return false; if (!GeneralUtilities.safeEquals(descriptorVisibility, d.getDescriptorVisibility())) return false; if (!equalMetadata((metadatas == null) ? EMPTY_METADATAS_MAP : metadatas, d.getMetadata())) return false; if (!GeneralUtilities.safeEquals(proxiable, d.isProxiable())) return false; if (!GeneralUtilities.safeEquals(proxyForSameScope, d.isProxyForSameScope())) return false; if (!GeneralUtilities.safeEquals(analysisName, d.getClassAnalysisName())) return false; return true; }
public boolean equals(Object a) { if (a == null) return false; if (!(a instanceof Descriptor)) return false; Descriptor d = (Descriptor) a; if (!GeneralUtilities.safeEquals(implementation, d.getImplementation())) return false; if (!equalOrderedCollection((contracts == null) ? EMPTY_CONTRACTS_SET : contracts, d.getAdvertisedContracts())) return false; if (!GeneralUtilities.safeEquals(name, d.getName())) return false; if (!GeneralUtilities.safeEquals(scope, d.getScope())) return false; if (!equalOrderedCollection((qualifiers == null) ? EMPTY_QUALIFIER_SET : qualifiers, d.getQualifiers())) return false; if (!GeneralUtilities.safeEquals(descriptorType, d.getDescriptorType())) return false; if (!GeneralUtilities.safeEquals(descriptorVisibility, d.getDescriptorVisibility())) return false; if (!equalMetadata((metadatas == null) ? EMPTY_METADATAS_MAP : metadatas, d.getMetadata())) return false; if (!GeneralUtilities.safeEquals(proxiable, d.isProxiable())) return false; if (!GeneralUtilities.safeEquals(proxyForSameScope, d.isProxyForSameScope())) return false; if (!GeneralUtilities.safeEquals(analysisName, d.getClassAnalysisName())) return false; return true; }