# CollectionSchemaField Class

> Allows for the creation of collection schema field objects.

- Product: Adobe PDF Library 21
- Language: Modern C++
- Version: 21.4.0
- HTML page: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/CollectionSchemaField
- Version index: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/llms.txt

```cpp
class CollectionSchemaField
```

**Namespace:** `datalogics_interface`

## Description

Allows for the creation of collection schema field objects.

Parameters that are part of a schema's field may be set.

**Referenced by:** [`CollectionSchema`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/CollectionSchema.md)

**Uses types:** [`SchemaFieldSubtype`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/SchemaFieldSubtype.md)

## Constructors

### CollectionSchemaField

```cpp
datalogics_interface::CollectionSchemaField::CollectionSchemaField(CollectionSchemaField &&) noexcept
```

*constructor*

**Parameters**

- (unnamed) ([`CollectionSchemaField &&`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/CollectionSchemaField.md))

### CollectionSchemaField

```cpp
datalogics_interface::CollectionSchemaField::CollectionSchemaField(const std::string &field_id, SchemaFieldSubtype subtype)
```

*constructor*

**Parameters**

- `field_id` (`const std::string &`): the schema field ID. The ID is used during creation and extraction of the schema field. It is the unique identifier of the schema field.
- `subtype` ([`SchemaFieldSubtype`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/SchemaFieldSubtype.md)): the schema field subtype. The subtypes are predefined. The value of this parameter must correspond to the one of the SchemaFieldSubtype enum values.

CCollectionSchemaField allows to create CollectionSchemaField object.

The constructor accepts identifier value and subtype required by the schema field.

### ~CollectionSchemaField

```cpp
datalogics_interface::CollectionSchemaField::~CollectionSchemaField()
```

*destructor*

## Methods

### get_editable

```cpp
bool datalogics_interface::CollectionSchemaField::get_editable() const
```

**Returns:** `bool`

whether edit mode is allowed or not.

GetEditable allows to obtain information about edit mode of the current field.

### get_id

```cpp
std::string datalogics_interface::CollectionSchemaField::get_id() const
```

**Returns:** `std::string`

the unique field's id.

GetID allows to obtain the unique id with which schema field has been created.

### get_index

```cpp
int datalogics_interface::CollectionSchemaField::get_index() const
```

**Returns:** `int`

the index of the field.

GetIndex allows to obtain field index.

### get_name

```cpp
std::string datalogics_interface::CollectionSchemaField::get_name() const
```

**Returns:** `std::string`

the field name.

GetName allows to obtain field name.

### get_subtype

```cpp
SchemaFieldSubtype datalogics_interface::CollectionSchemaField::get_subtype() const
```

**Returns:** [`SchemaFieldSubtype`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/SchemaFieldSubtype.md)

field subtype. One of the ShemaFieldSubtype enum values.

GetSubtype allows to obtain the field subtype.

### get_visible

```cpp
bool datalogics_interface::CollectionSchemaField::get_visible() const
```

**Returns:** `bool`

true if current schema field is visible, false otherwise.

GetVisible allows to obtain information about filed visibility.

### operator=

```cpp
CollectionSchemaField & datalogics_interface::CollectionSchemaField::operator=(CollectionSchemaField &&) noexcept
```

**Parameters**

- (unnamed) ([`CollectionSchemaField &&`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/CollectionSchemaField.md))

**Returns:** [`CollectionSchemaField &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/CollectionSchemaField.md)

### set_editable

```cpp
void datalogics_interface::CollectionSchemaField::set_editable(bool editable)
```

**Parameters**

- `editable` (`bool`): pass true to allow to edit this field or false otherwise.

**Returns:** `void`

SetEditable allows to change edit mode for shema field. Its value false by default.

### set_index

```cpp
void datalogics_interface::CollectionSchemaField::set_index(int index)
```

**Parameters**

- `index` (`int`): field index.

**Returns:** `void`

SetIndex allows to set field index.

NOTE: the field indexes are zero-based in ascending order without gaps.

### set_name

```cpp
void datalogics_interface::CollectionSchemaField::set_name(const std::string &name)
```

**Parameters**

- `name` (`const std::string &`): the new field name.

**Returns:** `void`

SetName allows to change field name.

### set_visible

```cpp
void datalogics_interface::CollectionSchemaField::set_visible(bool visible)
```

**Parameters**

- `visible` (`bool`): the visibility flag.

**Returns:** `void`

SetVisible allows to set field's default visibility. Its value true by default.
