if ( core instanceof Map ) {
if ( ! coreDef.isTraitable() ) {
throw new UnsupportedOperationException( "Error: cannot apply a trait to non-traitable class " + core.getClass() + ". Was it declared as @Traitable? ");
}
return coreDef.isFullTraiting() ? new LogicalMapCore( (Map) core ) : new MapCore( (Map) core );
}
CoreWrapper<K> wrapper = builder.getCoreWrapper( core.getClass(), coreDef );
if ( wrapper == null ) {
throw new UnsupportedOperationException( "Error: cannot apply a trait to non-traitable class " + core.getClass() + ". Was it declared as @Traitable? ");