Exemplo n.º 1
0
 @Override
 public void registerTrait(TraitInfo info) {
   Preconditions.checkNotNull(info, "info cannot be null");
   if (registered.containsKey(info.getTraitName())) {
     System.out.println(info.getTraitClass());
     throw new IllegalArgumentException("trait name already registered");
   }
   registered.put(info.getTraitName(), info);
   if (info.isDefaultTrait()) {
     defaultTraits.add(info);
   }
 }
Exemplo n.º 2
0
 @Override
 public void deregisterTrait(TraitInfo info) {
   Preconditions.checkNotNull(info, "info cannot be null");
   registered.remove(info.getTraitName());
 }