---
title: Schema.CompositeAttribute
framework: swiftdata
role: symbol
role_heading: Class
path: swiftdata/schema/compositeattribute
---

# Schema.CompositeAttribute

An object that describes an attribute that derives its value by composing other attributes.

## Declaration

```swift
final class CompositeAttribute
```

## Topics

### Creating a composite attribute

- [init(name:originalName:options:valueType:defaultValue:hashModifier:)](swiftdata/schema/compositeattribute/init(name:originalname:options:valuetype:defaultvalue:hashmodifier:).md)

### Composing attributes

- [properties](swiftdata/schema/compositeattribute/properties.md)

### Encoding and decoding

- [encode(to:)](swiftdata/schema/compositeattribute/encode(to:).md)
- [init(from:)](swiftdata/schema/compositeattribute/init(from:).md)

### Debugging

- [debugDescription](swiftdata/schema/compositeattribute/debugdescription.md)

### Operators

- [==(_:_:)](swiftdata/schema/compositeattribute/==(_:_:).md)

## Relationships

### Inherits From

- [Schema.Attribute](swiftdata/schema/attribute.md)

### Conforms To

- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [SchemaProperty](swiftdata/schemaproperty.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Attributes

- [Schema.Attribute](swiftdata/schema/attribute.md)
