* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdc.be.dao.cassandra.schema.tables;
import com.datastax.driver.core.DataType;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.openecomp.sdc.be.dao.cassandra.schema.ITableDescription;
import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants;
-import java.util.*;
-
-
public class OperationalEnvironmentsTableDescription implements ITableDescription {
private static final String OPERATIONAL_ENVIRONMENT_TABLE = "operationalEnvironment";
public Map<String, ImmutablePair<DataType, Boolean>> getColumnDescription() {
Map<String, ImmutablePair<DataType, Boolean>> columns = new HashMap<>();
Arrays.stream(SdcOperationalEnvironmentFieldsDescription.values())
- .forEach(column -> columns.put(column.getFieldName(), ImmutablePair.of(column.getFieldType(), column.isIndexed())));
+ .forEach(column -> columns.put(column.getFieldName(), ImmutablePair.of(column.getFieldType(), column.isIndexed())));
return columns;
}
@AllArgsConstructor
enum SdcOperationalEnvironmentFieldsDescription {
//there is also PK field "environmentID"
+ // @formatter:off
TENANT("tenant", DataType.varchar(), false),
IS_PRODUCTION("is_production", DataType.cboolean(), false),
ECOMP_WORKLOAD_CONTEXT("ecomp_workload_context", DataType.varchar(), false),
UEB_SECRET_KEY("ueb_secret_key",DataType.varchar(), false),
STATUS("status",DataType.varchar() ,true),
LAST_MODIFIED("last_modified",DataType.timestamp() ,false);
+ // @formatter:on
private final String fieldName;
private final DataType fieldType;
private final boolean isIndexed;
-
}
}