class Lutaml::Model::Type::String

def self.cast(value, options = {})

Performance-optimized cast with short-circuit for already-correct types
def self.cast(value, options = {})
  return nil if value.nil?
  return value if Utils.uninitialized?(value)
  # Short-circuit: return immediately if already a String with no options
  # Use identity check for EMPTY_OPTIONS (faster than .empty?)
  if value.is_a?(::String) && options.equal?(EMPTY_OPTIONS)
    return value
  end
  value = value.to_s
  unless options.equal?(EMPTY_OPTIONS)
    Model::Services::Type::Validator::String.validate!(value,
                                                       options)
  end
  value
end

def self.default_xsd_type

Returns:
  • (String) - xs:string
def self.default_xsd_type
  "xs:string"
end