@Override
 public int hashCode() {
   int result = 17;
   result = 31 * result + provider.hashCode();
   result = 31 * result + pid.hashCode();
   result = 31 * result + (factory ? 1 : 0);
   return result;
 }
 public String[] getLocales() {
   return provider.getLocales();
 }
    public EquinoxObjectClassDefinition getObjectClassDefinition(String id, String locale) {
      final ObjectClassDefinition ocd = provider.getObjectClassDefinition(id, locale);
      if (ocd == null) return null;
      return new EquinoxObjectClassDefinition() {
        public String getName() {
          return ocd.getName();
        }

        public String getID() {
          return ocd.getID();
        }

        public String getDescription() {
          return ocd.getDescription();
        }

        public InputStream getIcon(int size) throws IOException {
          return ocd.getIcon(size);
        }

        @SuppressWarnings("unchecked")
        public Map<String, String> getExtensionAttributes(String schema) {
          return Collections.EMPTY_MAP;
        }

        @SuppressWarnings("unchecked")
        public Set<String> getExtensionUris() {
          return Collections.EMPTY_SET;
        }

        public EquinoxAttributeDefinition[] getAttributeDefinitions(int filter) {
          AttributeDefinition[] ads = ocd.getAttributeDefinitions(filter);
          if (ads == null || ads.length == 0) return new EquinoxAttributeDefinition[0];
          Collection<EquinoxAttributeDefinition> result =
              new ArrayList<EquinoxAttributeDefinition>(ads.length);
          for (final AttributeDefinition ad : ads) {
            result.add(
                new EquinoxAttributeDefinition() {
                  public String getName() {
                    return ad.getName();
                  }

                  public String getID() {
                    return ad.getID();
                  }

                  public String getDescription() {
                    return ad.getDescription();
                  }

                  public int getCardinality() {
                    return ad.getCardinality();
                  }

                  public int getType() {
                    return ad.getType();
                  }

                  public String[] getOptionValues() {
                    return ad.getOptionValues();
                  }

                  public String[] getOptionLabels() {
                    return ad.getOptionLabels();
                  }

                  public String validate(String value) {
                    return ad.validate(value);
                  }

                  public String[] getDefaultValue() {
                    return ad.getDefaultValue();
                  }

                  @SuppressWarnings("unchecked")
                  public Map<String, String> getExtensionAttributes(String schema) {
                    return Collections.EMPTY_MAP;
                  }

                  @SuppressWarnings("unchecked")
                  public Set<String> getExtensionUris() {
                    return Collections.EMPTY_SET;
                  }
                });
          }
          return result.toArray(new EquinoxAttributeDefinition[result.size()]);
        }
      };
    }