Coggable

Overview

Cog supports converting directly to and from implementations of java.util.List, and with com.partnersoft.data.Naming. It also supports conversion to and from other types of Java object via the Coggable interface.

An implementation of Coggable must:

  • provide a constructor that takes a single cog as argument
  • provide a toCog() method that returns a single cog

The constructor should treat the input cog as the desired state of the new object. The toCog() method must return the state of the existing object.

Coggable uses a constructor to set state, rather than a fromCog() or similar method. This allows the implementation of Immutable cogs, that have their entire state set at construction time and then cannot be modified.

Table Of Contents

Previous topic

Model

Next topic

CogSchema

This Page