org.apache.pdfbox.pdmodel.graphics.optionalcontent

## Class PDOptionalContentGroup

- java.lang.Object
- - org.apache.pdfbox.pdmodel.documentinterchange.markedcontent.PDPropertyList
  - - org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentGroup

All Implemented Interfaces:
  COSObjectable

    public class PDOptionalContentGroup
    extends PDPropertyList

An optional content group (OCG).

### Nested Class Summary

Nested Classes
`static class` `PDOptionalContentGroup.RenderState` Enumeration for the renderState dictionary entry on the "Export", "View" and "Print" dictionary.

### Field Summary

### Fields inherited from class org.apache.pdfbox.pdmodel.documentinterchange.markedcontent.PDPropertyList

`dict`

### Constructor Summary

Constructors
Constructor and Description
`PDOptionalContentGroup(COSDictionary dict)` Creates a new instance based on a given `COSDictionary`.
`PDOptionalContentGroup(String name)` Creates a new optional content group (OCG).

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `getName()` Returns the name of the optional content group.
`PDOptionalContentGroup.RenderState` `getRenderState(RenderDestination destination)`
`void` `setName(String name)` Sets the name of the optional content group.
`String` `toString()`

### Methods inherited from class org.apache.pdfbox.pdmodel.documentinterchange.markedcontent.PDPropertyList

`create, getCOSObject`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### PDOptionalContentGroup

    public PDOptionalContentGroup(String name)

Creates a new optional content group (OCG).

Parameters:
  `name` - the name of the content group

#### PDOptionalContentGroup

    public PDOptionalContentGroup(COSDictionary dict)

Creates a new instance based on a given `COSDictionary`.

Parameters:
  `dict` - the dictionary

### Method Detail

#### getName

    public String getName()

Returns the name of the optional content group.

Returns:
  the name

#### setName

    public void setName(String name)

Sets the name of the optional content group.

Parameters:
  `name` - the name

#### getRenderState

    public PDOptionalContentGroup.RenderState getRenderState(RenderDestination destination)

Parameters:
  `destination` - to be rendered
Returns:
  state or null if undefined

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`