public final class ReadOnlyObjects extends Object
GHMeta wraps the list of GitHub's IP addresses.
This class is used to show examples of different ways to create simple read-only data objects. For data objects that can be modified, perform actions, or get other objects we'll need other examples.
IMPORTANT: There is no one right way to do this, but there are better and worse.
ReadOnlyObjects.GHMetaGettersUnmodifiable is a good balance of clarity and brevityReadOnlyObjects.GHMetaPublic exposes setters that are not needed, making it unclear that fields are actually
read-only| Modifier and Type | Class and Description |
|---|---|
static interface |
ReadOnlyObjects.GHMetaExample
All GHMeta data objects should expose these values.
|
static class |
ReadOnlyObjects.GHMetaGettersFinal
This version uses only public getters and returns unmodifiable lists and has final fields
|
static class |
ReadOnlyObjects.GHMetaGettersFinalCreator
This version uses only public getters and returns unmodifiable lists
|
static class |
ReadOnlyObjects.GHMetaGettersUnmodifiable
This version uses only public getters and returns unmodifiable lists.
|
static class |
ReadOnlyObjects.GHMetaPackage
This version uses public getters and shows that package or private setters both can be used by jackson.
|
static class |
ReadOnlyObjects.GHMetaPublic
This version uses public getters and setters and leaves it up to Jackson how it wants to fill them.
|
| Constructor and Description |
|---|
ReadOnlyObjects() |
Copyright © 2020. All rights reserved.