2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017-2018 Amdocs
7 * ===================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
21 package org.onap.aai.champcore.model.fluent.index.impl;
23 import org.onap.aai.champcore.model.ChampField;
24 import org.onap.aai.champcore.model.ChampObject;
25 import org.onap.aai.champcore.model.ChampObjectIndex;
26 import org.onap.aai.champcore.model.fluent.BuildStep;
27 import org.onap.aai.champcore.model.fluent.index.CreateObjectIndexable;
28 import org.onap.aai.champcore.model.fluent.index.ObjectIndexFieldStep;
29 import org.onap.aai.champcore.model.fluent.index.ObjectIndexTypeStep;
31 public final class CreateObjectIndexableImpl implements CreateObjectIndexable {
34 public ObjectIndexTypeStep ofName(String name) {
35 return new ObjectIndexTypeStep() {
38 public ObjectIndexFieldStep onType(String objectType) {
39 return new ObjectIndexFieldStep() {
42 public BuildStep<ChampObjectIndex> forField(String fieldName) {
43 return new BuildStep<ChampObjectIndex> () {
46 public ChampObjectIndex build() {
47 return new ChampObjectIndex.Builder(
48 name, objectType, new ChampField.Builder(fieldName).build()
57 public ObjectIndexFieldStep onAnyType() {
58 return new ObjectIndexFieldStep() {
61 public BuildStep<ChampObjectIndex> forField(String fieldName) {
62 return new BuildStep<ChampObjectIndex> () {
65 public ChampObjectIndex build() {
66 return new ChampObjectIndex.Builder(
67 name, ChampObject.ReservedTypes.ANY.toString(), new ChampField.Builder(fieldName).build()