/** * Creates an immutable copy of a {@link SMFAttributeNameType} value. * Uses accessors to get values to initialize the new immutable instance. * If an instance is already immutable, it is returned as is. * @param instance The instance to copy * @return A copied immutable SMFAttributeName instance */ public static SMFAttributeName copyOf(SMFAttributeNameType instance) { if (instance instanceof SMFAttributeName) { return (SMFAttributeName) instance; } return SMFAttributeName.builder() .from(instance) .build(); }
/** * Creates an immutable copy of a {@link SMFAttributeNameType} value. * Uses accessors to get values to initialize the new immutable instance. * If an instance is already immutable, it is returned as is. * @param instance The instance to copy * @return A copied immutable SMFAttributeName instance */ public static SMFAttributeName copyOf(SMFAttributeNameType instance) { if (instance instanceof SMFAttributeName) { return (SMFAttributeName) instance; } return SMFAttributeName.builder() .from(instance) .build(); }