/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.teraflow.automation.context.model;
public interface LocationType<T> {
public T getLocationType();
}
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.teraflow.automation.context.model;
public class LocationTypeGpsPosition implements LocationType<GpsPosition> {
private final GpsPosition gpsPosition;
public LocationTypeGpsPosition(GpsPosition gpsPosition) {
this.gpsPosition = gpsPosition;
}
@Override
public GpsPosition getLocationType() {
return this.gpsPosition;
}
@Override
public String toString() {
return String.format("%s:{%s}", getClass().getSimpleName(), gpsPosition);
}
}
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.teraflow.automation.context.model;
public class LocationTypeRegion implements LocationType<String> {
private final String region;
public LocationTypeRegion(String region) {
this.region = region;
}
@Override
public String getLocationType() {
return this.region;
}
@Override
public String toString() {
return String.format("%s:{region:\"%s\"}", getClass().getSimpleName(), region);
}
}
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.teraflow.automation.context.model;
public class TopologyId {
private final String contextId;
private final String id;
public TopologyId(String contextId, String id) {
this.contextId = contextId;
this.id = id;
}
public String getContextId() {
return contextId;
}
public String getId() {
return id;
}
@Override
public String toString() {
return String.format(
"%s:{contextId:\"%s\", id:\"%s\"}", getClass().getSimpleName(), contextId, id);
}
}
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.teraflow.automation.device;
import eu.teraflow.automation.context.model.Device;
import eu.teraflow.automation.context.model.DeviceConfig;
import eu.teraflow.automation.context.model.Empty;
import io.smallrye.mutiny.Uni;
public interface DeviceGateway {
Uni<DeviceConfig> getInitialConfiguration(String deviceId);
Uni<String> configureDevice(Device device);
Uni<Empty> deleteDevice(String deviceId);
}
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.teraflow.automation.device;
import device.DeviceService;
import eu.teraflow.automation.Serializer;
import eu.teraflow.automation.context.model.Device;
import eu.teraflow.automation.context.model.DeviceConfig;
import eu.teraflow.automation.context.model.Empty;
import io.quarkus.grpc.GrpcClient;
import io.smallrye.mutiny.Uni;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
@ApplicationScoped
public class DeviceGatewayImpl implements DeviceGateway {
@GrpcClient("device")
DeviceService deviceDelegate;
private final Serializer serializer;
@Inject
public DeviceGatewayImpl(Serializer serializer) {
this.serializer = serializer;
}
@Override
public Uni<DeviceConfig> getInitialConfiguration(String deviceId) {
final var serializedDeviceId = serializer.serializeDeviceId(deviceId);
return deviceDelegate
.getInitialConfig(serializedDeviceId)
.onItem()
.transform(serializer::deserialize);
}
@Override
public Uni<String> configureDevice(Device device) {
final var serializedDevice = serializer.serialize(device);
return deviceDelegate
.configureDevice(serializedDevice)
.onItem()
.transform(serializer::deserialize);
}
@Override
public Uni<Empty> deleteDevice(String deviceId) {
final var serializedDeviceId = serializer.serializeDeviceId(deviceId);
return deviceDelegate
.deleteDevice(serializedDeviceId)
.onItem()
.transform(serializer::deserializeEmpty);
}
}
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.teraflow.automation.device;
import eu.teraflow.automation.context.model.Device;
import eu.teraflow.automation.context.model.DeviceConfig;
import eu.teraflow.automation.context.model.Empty;
import io.smallrye.mutiny.Uni;
public interface DeviceService {
Uni<DeviceConfig> getInitialConfiguration(String deviceId);
Uni<String> configureDevice(Device device);
Uni<Empty> deleteDevice(String deviceId);
}
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.teraflow.automation.device;
import eu.teraflow.automation.context.model.Device;
import eu.teraflow.automation.context.model.DeviceConfig;
import eu.teraflow.automation.context.model.Empty;
import io.smallrye.mutiny.Uni;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
@ApplicationScoped
public class DeviceServiceImpl implements DeviceService {
private final DeviceGateway deviceGateway;
@Inject
public DeviceServiceImpl(DeviceGateway deviceGateway) {
this.deviceGateway = deviceGateway;
}
@Override
public Uni<DeviceConfig> getInitialConfiguration(String deviceId) {
return deviceGateway.getInitialConfiguration(deviceId);
}
@Override
public Uni<String> configureDevice(Device device) {
return deviceGateway.configureDevice(device);
}
@Override
public Uni<Empty> deleteDevice(String deviceId) {
return deviceGateway.deleteDevice(deviceId);
}
}
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.teraflow.automation.kpi_sample_types.model;
public enum KpiSampleType {
UNKNOWN,
PACKETS_TRANSMITTED,
PACKETS_RECEIVED,
BYTES_TRANSMITTED,
BYTES_RECEIVED
}
../../../../../proto/automation.proto
\ No newline at end of file
_______ ______ _ _ _ _
|__ __| | ____| | /\ | | | | (_)
| | ___ _ __ __ _| |__ | | _____ __ / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __
| |/ _ \ '__/ _` | __| | |/ _ \ \ /\ / / / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \
| | __/ | | (_| | | | | (_) \ V V / / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | |
|_|\___|_| \__,_|_| |_|\___/ \_/\_/ /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.teraflow.automation;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import automation.Automation;
import context.ContextOuterClass;
import eu.teraflow.automation.context.ContextGateway;
import eu.teraflow.automation.context.model.ConfigActionEnum;
import eu.teraflow.automation.context.model.ConfigRule;
import eu.teraflow.automation.context.model.ConfigRuleCustom;
import eu.teraflow.automation.context.model.ConfigRuleTypeCustom;
import eu.teraflow.automation.context.model.Device;
import eu.teraflow.automation.context.model.DeviceConfig;
import eu.teraflow.automation.context.model.DeviceDriverEnum;
import eu.teraflow.automation.context.model.DeviceOperationalStatus;
import eu.teraflow.automation.context.model.EndPoint.EndPointBuilder;
import eu.teraflow.automation.context.model.EndPointId;
import eu.teraflow.automation.context.model.Location;
import eu.teraflow.automation.context.model.LocationTypeRegion;
import eu.teraflow.automation.context.model.TopologyId;
import eu.teraflow.automation.device.DeviceGateway;
import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.mockito.InjectMock;
import io.smallrye.mutiny.Uni;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import javax.inject.Inject;
import org.assertj.core.api.Assertions;
import org.jboss.logging.Logger;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
@QuarkusTest
class AutomationFunctionalServiceTest {
private static final Logger LOGGER = Logger.getLogger(AutomationFunctionalServiceTest.class);
@Inject AutomationService automationService;
@InjectMock DeviceGateway deviceGateway;
@InjectMock ContextGateway contextGateway;
@Test
void shouldConfigureDevice() {
final var uuidForDeviceRoleId =
ContextOuterClass.Uuid.newBuilder()
.setUuid(UUID.fromString("0f14d0ab-9608-7862-a9e4-5ed26688389b").toString())
.build();
final var uuidForDeviceId =
ContextOuterClass.Uuid.newBuilder()
.setUuid(UUID.fromString("9f14d0ab-9608-7862-a9e4-5ed26688389c").toString())
.build();
final var outDeviceId =
ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build();
final var outDeviceRoleId =
Automation.DeviceRoleId.newBuilder()
.setDevRoleId(uuidForDeviceRoleId)
.setDevId(outDeviceId)
.build();
String deviceId = outDeviceRoleId.getDevRoleId().toString();
String deviceName = "deviceName";
String deviceType = "cisco";
final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA);
ConfigRule configRule1 = new ConfigRule(ConfigActionEnum.UNDEFINED, configRuleTypeA);
final var configRuleCustomB = new ConfigRuleCustom("resourceKeyB", "resourceValueB");
final var configRuleTypeB = new ConfigRuleTypeCustom(configRuleCustomB);
ConfigRule configRule2 = new ConfigRule(ConfigActionEnum.SET, configRuleTypeB);
List<ConfigRule> configRuleList = new ArrayList<>();
configRuleList.add(configRule1);
configRuleList.add(configRule2);
DeviceConfig expectedDeviceConfig = new DeviceConfig(configRuleList);
Uni<DeviceConfig> expectedDeviceConfigUni = Uni.createFrom().item(expectedDeviceConfig);
Uni<String> expectedDeviceId = Uni.createFrom().item(deviceId);
final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4);
final var topologyIdA = new TopologyId("contextIdA", "idA");
final var deviceIdA = "deviceIdA";
final var idA = "idA";
final var endPointIdA = new EndPointId(topologyIdA, deviceIdA, idA);
final var endPointTypeA = "endPointTypeA";
final var kpiSampleTypesA =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegionA = new LocationTypeRegion("ATH");
final var locationA = new Location(locationTypeRegionA);
final var endPointA =
new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA)
.location(locationA)
.build();
final var topologyIdB = new TopologyId("contextIdB", "idB");
final var deviceIdB = "deviceIdB";
final var idB = "idB";
final var endPointIdB = new EndPointId(topologyIdB, deviceIdB, idB);
final var endPointTypeB = "endPointTypeB";
final var kpiSampleTypesB =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegionB = new LocationTypeRegion("ATH");
final var locationB = new Location(locationTypeRegionB);
final var endPointB =
new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB)
.location(locationB)
.build();
final var endPoints = List.of(endPointA, endPointB);
Device device =
new Device(
deviceId,
deviceName,
deviceType,
DeviceOperationalStatus.DISABLED,
deviceDrivers,
endPoints);
Uni<Device> deviceUni = Uni.createFrom().item(device);
Mockito.when(contextGateway.getDevice(Mockito.any())).thenReturn(deviceUni);
Mockito.when(deviceGateway.getInitialConfiguration(Mockito.any()))
.thenReturn(expectedDeviceConfigUni);
Mockito.when(deviceGateway.configureDevice(Mockito.any())).thenReturn(expectedDeviceId);
final var currentDevice = automationService.addDevice(deviceId);
Assertions.assertThat(currentDevice).isNotNull();
currentDevice
.subscribe()
.with(
deviceConfig -> {
LOGGER.infof("Received response %s", deviceConfig);
assertThat(deviceConfig).hasToString(device.getDeviceOperationalStatus().toString());
assertThat(deviceConfig.getDeviceConfig().toString()).isNotNull();
final var rulesList = deviceConfig.getDeviceConfig().getConfigRules();
for (int i = 0; i < rulesList.size(); i++) {
if (rulesList.get(i).getConfigRuleType().getConfigRuleType()
instanceof ConfigRuleCustom) {
assertThat(
((ConfigRuleCustom)
rulesList.get(i).getConfigRuleType().getConfigRuleType())
.getResourceKey())
.isEqualTo(String.valueOf(i + 1));
assertThat(
((ConfigRuleCustom)
rulesList.get(i).getConfigRuleType().getConfigRuleType())
.getResourceValue())
.isEqualTo(String.valueOf(i + 1));
}
}
assertThat(deviceConfig.getDeviceType()).isEqualTo("cisco");
assertThat(deviceConfig.getDeviceId()).isEqualTo(deviceId);
});
}
@Test
void shouldNotConfigureDevice() {
final var uuidForDeviceRoleId =
ContextOuterClass.Uuid.newBuilder()
.setUuid(UUID.fromString("2f14d0ab-9608-7862-a9e4-5ed26688389f").toString())
.build();
final var uuidForDeviceId =
ContextOuterClass.Uuid.newBuilder()
.setUuid(UUID.fromString("3f14d0ab-9608-7862-a9e4-5ed26688389d").toString())
.build();
final var outDeviceId =
ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build();
final var outDeviceRoleId =
Automation.DeviceRoleId.newBuilder()
.setDevRoleId(uuidForDeviceRoleId)
.setDevId(outDeviceId)
.build();
String deviceId = outDeviceRoleId.getDevId().toString();
String deviceName = "deviceName";
String deviceType = "ztp";
List<ConfigRule> configRuleList = new ArrayList<>();
final var configRuleCustom = new ConfigRuleCustom("resourceKey", "resourceValue");
final var configRuleType = new ConfigRuleTypeCustom(configRuleCustom);
ConfigRule expectedConfigRule = new ConfigRule(ConfigActionEnum.UNDEFINED, configRuleType);
configRuleList.add(expectedConfigRule);
DeviceConfig expectedDeviceConfig = new DeviceConfig(configRuleList);
final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4);
final var topologyIdA = new TopologyId("contextIdA", "idA");
final var deviceIdA = "deviceIdA";
final var idA = "idA";
final var endPointIdA = new EndPointId(topologyIdA, deviceIdA, idA);
final var endPointTypeA = "endPointTypeA";
final var kpiSampleTypesA =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegionA = new LocationTypeRegion("ATH");
final var locationA = new Location(locationTypeRegionA);
final var endPointA =
new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA)
.location(locationA)
.build();
final var topologyIdB = new TopologyId("contextIdB", "idB");
final var deviceIdB = "deviceIdB";
final var idB = "idB";
final var endPointIdB = new EndPointId(topologyIdB, deviceIdB, idB);
final var endPointTypeB = "endPointTypeB";
final var kpiSampleTypesB =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegionB = new LocationTypeRegion("ATH");
final var locationB = new Location(locationTypeRegionB);
final var endPointB =
new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB)
.location(locationB)
.build();
final var endPoints = List.of(endPointA, endPointB);
Device device =
new Device(
deviceId,
deviceName,
deviceType,
expectedDeviceConfig,
DeviceOperationalStatus.ENABLED,
deviceDrivers,
endPoints);
Uni<Device> deviceUni = Uni.createFrom().item(device);
Mockito.when(contextGateway.getDevice(Mockito.any())).thenReturn(deviceUni);
final var currentDevice = automationService.addDevice(deviceId);
Assertions.assertThat(currentDevice).isNotNull();
currentDevice
.subscribe()
.with(
deviceConfig -> {
LOGGER.infof("Received response %s", deviceConfig);
assertThat(deviceConfig).hasToString(device.getDeviceOperationalStatus().toString());
assertThat(deviceConfig.getDeviceConfig().toString()).isNotNull();
final var rulesList = deviceConfig.getDeviceConfig().getConfigRules();
for (ConfigRule configRule : rulesList) {
if (configRule.getConfigRuleType().getConfigRuleType()
instanceof ConfigRuleCustom) {
if (expectedConfigRule.getConfigRuleType().getConfigRuleType()
instanceof ConfigRuleCustom) {
assertThat(
((ConfigRuleCustom) configRule.getConfigRuleType().getConfigRuleType())
.getResourceKey())
.isEqualTo(
((ConfigRuleCustom)
expectedConfigRule.getConfigRuleType().getConfigRuleType())
.getResourceKey());
assertThat(
((ConfigRuleCustom) configRule.getConfigRuleType().getConfigRuleType())
.getResourceValue())
.isEqualTo(
((ConfigRuleCustom)
expectedConfigRule.getConfigRuleType().getConfigRuleType())
.getResourceValue());
}
}
}
assertThat(deviceConfig.getDeviceType()).isEqualTo("ztp");
assertThat(deviceConfig.getDeviceId()).isEqualTo(deviceId);
});
}
@Test
void shouldDeleteDevice() {
final var uuidForDeviceRoleId =
ContextOuterClass.Uuid.newBuilder()
.setUuid(UUID.fromString("0f14d0ab-9608-7862-a9e4-5ed26688389b").toString())
.build();
final var uuidForDeviceId =
ContextOuterClass.Uuid.newBuilder()
.setUuid(UUID.fromString("9f14d0ab-9608-7862-a9e4-5ed26688389c").toString())
.build();
final var outDeviceId =
ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(uuidForDeviceId).build();
final var outDeviceRoleId =
Automation.DeviceRoleId.newBuilder()
.setDevRoleId(uuidForDeviceRoleId)
.setDevId(outDeviceId)
.build();
String deviceId = outDeviceRoleId.getDevRoleId().toString();
String deviceName = "deviceName";
String deviceType = "cisco";
final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4);
final var topologyIdA = new TopologyId("contextIdA", "idA");
final var deviceIdA = "deviceIdA";
final var idA = "idA";
final var endPointIdA = new EndPointId(topologyIdA, deviceIdA, idA);
final var endPointTypeA = "endPointTypeA";
final var kpiSampleTypesA =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegionA = new LocationTypeRegion("ATH");
final var locationA = new Location(locationTypeRegionA);
final var endPointA =
new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA)
.location(locationA)
.build();
final var topologyIdB = new TopologyId("contextIdB", "idB");
final var deviceIdB = "deviceIdB";
final var idB = "idB";
final var endPointIdB = new EndPointId(topologyIdB, deviceIdB, idB);
final var endPointTypeB = "endPointTypeB";
final var kpiSampleTypesB =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegionB = new LocationTypeRegion("ATH");
final var locationB = new Location(locationTypeRegionB);
final var endPointB =
new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB)
.location(locationB)
.build();
final var endPoints = List.of(endPointA, endPointB);
Device device =
new Device(
deviceId,
deviceName,
deviceType,
DeviceOperationalStatus.DISABLED,
deviceDrivers,
endPoints);
Uni<Device> deviceUni = Uni.createFrom().item(device);
Mockito.when(contextGateway.getDevice(Mockito.any())).thenReturn(deviceUni);
final var deletedDevice = automationService.deleteDevice(deviceId);
Assertions.assertThat(deletedDevice).isNotNull();
deletedDevice
.subscribe()
.with(
removedDevice -> {
assertThat(removedDevice).isEqualTo(deletedDevice);
});
}
}
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.teraflow.automation;
import static org.assertj.core.api.Assertions.assertThat;
import automation.Automation;
import automation.AutomationService;
import context.ContextOuterClass;
import eu.teraflow.automation.context.ContextGateway;
import eu.teraflow.automation.context.model.ConfigActionEnum;
import eu.teraflow.automation.context.model.ConfigRule;
import eu.teraflow.automation.context.model.ConfigRuleCustom;
import eu.teraflow.automation.context.model.ConfigRuleTypeCustom;
import eu.teraflow.automation.context.model.Device;
import eu.teraflow.automation.context.model.DeviceConfig;
import eu.teraflow.automation.context.model.DeviceDriverEnum;
import eu.teraflow.automation.context.model.DeviceOperationalStatus;
import eu.teraflow.automation.context.model.EndPoint.EndPointBuilder;
import eu.teraflow.automation.context.model.EndPointId;
import eu.teraflow.automation.context.model.Location;
import eu.teraflow.automation.context.model.LocationTypeRegion;
import eu.teraflow.automation.context.model.TopologyId;
import eu.teraflow.automation.device.DeviceGateway;
import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType;
import eu.teraflow.automation.model.DeviceRole;
import eu.teraflow.automation.model.DeviceRoleConfig;
import eu.teraflow.automation.model.DeviceRoleId;
import eu.teraflow.automation.model.DeviceRoleType;
import io.quarkus.grpc.GrpcClient;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.mockito.InjectMock;
import io.smallrye.mutiny.Uni;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import javax.inject.Inject;
import org.jboss.logging.Logger;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
@QuarkusTest
class AutomationServiceTest {
private static final Logger LOGGER = Logger.getLogger(AutomationServiceTest.class);
@GrpcClient AutomationService client;
private final Serializer serializer;
@InjectMock DeviceGateway deviceGateway;
@InjectMock ContextGateway contextGateway;
@Inject
AutomationServiceTest(Serializer serializer) {
this.serializer = serializer;
}
@Test
void shouldAddDeviceRole() throws ExecutionException, InterruptedException, TimeoutException {
final var message = new CompletableFuture<>();
final var DEVICE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389b";
final var DEVICE_ROLE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389a";
final var DEVICE_NAME = "deviceNameA";
final var DEVICE_TYPE = "ztp";
final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4);
final var topologyIdA = new TopologyId("contextIdA", "idA");
final var deviceIdA = "deviceIdA";
final var idA = "idA";
final var endPointIdA = new EndPointId(topologyIdA, deviceIdA, idA);
final var endPointTypeA = "endPointTypeA";
final var kpiSampleTypesA =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegionA = new LocationTypeRegion("ATH");
final var locationA = new Location(locationTypeRegionA);
final var endPointA =
new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA)
.location(locationA)
.build();
final var topologyIdB = new TopologyId("contextIdB", "idB");
final var deviceIdB = "deviceIdB";
final var idB = "idB";
final var endPointIdB = new EndPointId(topologyIdB, deviceIdB, idB);
final var endPointTypeB = "endPointTypeB";
final var kpiSampleTypesB =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegionB = new LocationTypeRegion("ATH");
final var locationB = new Location(locationTypeRegionB);
final var endPointB =
new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB)
.location(locationB)
.build();
final var endPoints = List.of(endPointA, endPointB);
final var emptyDeviceConfig = new DeviceConfig(List.of());
final var disabledDevice =
new Device(
DEVICE_ID,
DEVICE_NAME,
DEVICE_TYPE,
emptyDeviceConfig,
DeviceOperationalStatus.DISABLED,
deviceDrivers,
endPoints);
Mockito.when(contextGateway.getDevice(Mockito.any()))
.thenReturn(Uni.createFrom().item(disabledDevice));
final var configRuleCustom = new ConfigRuleCustom("resourceKey", "resourceValue");
final var configRuleType = new ConfigRuleTypeCustom(configRuleCustom);
final var configRule = new ConfigRule(ConfigActionEnum.SET, configRuleType);
final var initialDeviceConfig = new DeviceConfig(List.of(configRule));
Mockito.when(deviceGateway.getInitialConfiguration(Mockito.any()))
.thenReturn(Uni.createFrom().item(initialDeviceConfig));
Mockito.when(deviceGateway.configureDevice(Mockito.any()))
.thenReturn(Uni.createFrom().item(DEVICE_ID));
final var deviceRoleId = new DeviceRoleId(DEVICE_ROLE_ID, DEVICE_ID);
final var deviceRoleType = DeviceRoleType.DEV_OPS;
final var deviceRole = new DeviceRole(deviceRoleId, deviceRoleType);
final var serializedDeviceRole = serializer.serialize(deviceRole);
client
.ztpAdd(serializedDeviceRole)
.subscribe()
.with(
deviceRoleState -> {
LOGGER.infof("Received %s", deviceRoleState);
final var devRoleId = deviceRoleState.getDevRoleId();
final var deviceRoleIdUuid = serializer.deserialize(devRoleId);
assertThat(deviceRoleIdUuid.getId()).isEqualTo(DEVICE_ROLE_ID);
final var deviceId = serializer.deserialize(devRoleId.getDevId());
assertThat(deviceId).isEqualTo(DEVICE_ID);
final var devRoleUuid = serializer.deserialize(devRoleId.getDevRoleId());
message.complete(devRoleUuid);
});
assertThat(message.get(5, TimeUnit.SECONDS)).isEqualTo(DEVICE_ROLE_ID);
}
@Test
void shouldUpdateDeviceRole() throws ExecutionException, InterruptedException, TimeoutException {
CompletableFuture<String> message = new CompletableFuture<>();
final var DEVICE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389b";
final var DEVICE_ROLE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389a";
final var DEVICE_NAME = "deviceNameA";
final var DEVICE_TYPE = "ztp";
final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4);
final var topologyIdA = new TopologyId("contextIdA", "idA");
final var deviceIdA = "deviceIdA";
final var idA = "idA";
final var endPointIdA = new EndPointId(topologyIdA, deviceIdA, idA);
final var endPointTypeA = "endPointTypeA";
final var kpiSampleTypesA =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegionA = new LocationTypeRegion("ATH");
final var locationA = new Location(locationTypeRegionA);
final var endPointA =
new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA)
.location(locationA)
.build();
final var topologyIdB = new TopologyId("contextIdB", "idB");
final var deviceIdB = "deviceIdB";
final var idB = "idB";
final var endPointIdB = new EndPointId(topologyIdB, deviceIdB, idB);
final var endPointTypeB = "endPointTypeB";
final var kpiSampleTypesB =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegionB = new LocationTypeRegion("ATH");
final var locationB = new Location(locationTypeRegionB);
final var endPointB =
new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB)
.location(locationB)
.build();
final var endPoints = List.of(endPointA, endPointB);
final var emptyDeviceConfig = new DeviceConfig(List.of());
final var device =
new Device(
DEVICE_ID,
DEVICE_NAME,
DEVICE_TYPE,
emptyDeviceConfig,
DeviceOperationalStatus.ENABLED,
deviceDrivers,
endPoints);
Mockito.when(contextGateway.getDevice(Mockito.any())).thenReturn(Uni.createFrom().item(device));
final var deviceRoleId = new DeviceRoleId(DEVICE_ROLE_ID, DEVICE_ID);
final var deviceRole = new DeviceRole(deviceRoleId, DeviceRoleType.DEV_OPS);
final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA);
final var deviceConfig =
new DeviceConfig(List.of(new ConfigRule(ConfigActionEnum.SET, configRuleTypeA)));
final var deviceRoleConfig = new DeviceRoleConfig(deviceRole, deviceConfig);
final var serializedDeviceRoleConfig = serializer.serialize(deviceRoleConfig);
client
.ztpUpdate(serializedDeviceRoleConfig)
.subscribe()
.with(
deviceRoleState -> {
LOGGER.infof("Received response %s", deviceRoleState);
message.complete(deviceRoleState.getDevRoleId().toString());
});
assertThat(message.get(5, TimeUnit.SECONDS)).contains(DEVICE_ID);
}
@Test
void shouldGetDeviceRole() throws ExecutionException, InterruptedException, TimeoutException {
CompletableFuture<String> message = new CompletableFuture<>();
final var DEVICE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389b";
final var DEVICE_ROLE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389a";
final var deviceRoleId = new DeviceRoleId(DEVICE_ROLE_ID, DEVICE_ID);
final var serializeDeviceRoleId = serializer.serialize(deviceRoleId);
client
.ztpGetDeviceRole(serializeDeviceRoleId)
.subscribe()
.with(
deviceRole -> {
LOGGER.infof("Received response %s", deviceRole);
assertThat(deviceRole.getDevRoleId().getDevId().getDeviceUuid().getUuid())
.isEqualTo(DEVICE_ID);
message.complete(deviceRole.getDevRoleId().toString());
});
assertThat(message.get(5, TimeUnit.SECONDS)).contains(DEVICE_ROLE_ID);
}
@Test
void shouldGetAllDeviceRolesByDeviceId()
throws ExecutionException, InterruptedException, TimeoutException {
CompletableFuture<String> message = new CompletableFuture<>();
final var deviceId = serializer.serializeDeviceId("0f14d0ab-9605-7862-a9e4-5ed26688389b");
client
.ztpGetDeviceRolesByDeviceId(deviceId)
.subscribe()
.with(
deviceRoleList -> {
LOGGER.infof("Received response %s", deviceRoleList);
message.complete(deviceRoleList.toString());
});
assertThat(message.get(5, TimeUnit.SECONDS)).isEmpty();
}
@Test
void shouldDeleteDeviceRole() throws ExecutionException, InterruptedException, TimeoutException {
CompletableFuture<String> message = new CompletableFuture<>();
final var UUID_VALUE = "0f14d0ab-9605-7862-a9e4-5ed26688389b";
final var uuid = serializer.serializeUuid(UUID_VALUE);
final var deviceRoleId = Automation.DeviceRoleId.newBuilder().setDevRoleId(uuid).build();
final var deviceRole = Automation.DeviceRole.newBuilder().setDevRoleId(deviceRoleId).build();
final var DEVICE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389b";
final var DEVICE_ROLE_ID = "0f14d0ab-9608-7862-a9e4-5ed26688389a";
final var DEVICE_NAME = "deviceNameA";
final var DEVICE_TYPE = "ztp";
final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4);
final var topologyIdA = new TopologyId("contextIdA", "idA");
final var deviceIdA = "deviceIdA";
final var idA = "idA";
final var endPointIdA = new EndPointId(topologyIdA, deviceIdA, idA);
final var endPointTypeA = "endPointTypeA";
final var kpiSampleTypesA =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegionA = new LocationTypeRegion("ATH");
final var locationA = new Location(locationTypeRegionA);
final var endPointA =
new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA)
.location(locationA)
.build();
final var topologyIdB = new TopologyId("contextIdB", "idB");
final var deviceIdB = "deviceIdB";
final var idB = "idB";
final var endPointIdB = new EndPointId(topologyIdB, deviceIdB, idB);
final var endPointTypeB = "endPointTypeB";
final var kpiSampleTypesB =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegionB = new LocationTypeRegion("ATH");
final var locationB = new Location(locationTypeRegionB);
final var endPointB =
new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB)
.location(locationB)
.build();
final var endPoints = List.of(endPointA, endPointB);
final var emptyDeviceConfig = new DeviceConfig(List.of());
final var device =
new Device(
DEVICE_ID,
DEVICE_NAME,
DEVICE_TYPE,
emptyDeviceConfig,
DeviceOperationalStatus.ENABLED,
deviceDrivers,
endPoints);
Mockito.when(contextGateway.getDevice(Mockito.any())).thenReturn(Uni.createFrom().item(device));
client
.ztpDelete(deviceRole)
.subscribe()
.with(
deviceRoleState -> {
LOGGER.infof("Received response %s", deviceRoleState);
message.complete(deviceRoleState.getDevRoleId().toString());
});
assertThat(message.get(5, TimeUnit.SECONDS)).contains(UUID_VALUE);
}
@Test
void shouldDeleteAllDevicesRolesByDeviceId()
throws ExecutionException, InterruptedException, TimeoutException {
CompletableFuture<String> message = new CompletableFuture<>();
final var empty = ContextOuterClass.Empty.newBuilder().build();
client
.ztpDeleteAll(empty)
.subscribe()
.with(
deletionResult -> {
LOGGER.infof("Received response %s", deletionResult);
message.complete(deletionResult.toString());
});
assertThat(message.get(5, TimeUnit.SECONDS)).isEmpty();
}
}
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.teraflow.automation;
import static org.assertj.core.api.Assertions.assertThat;
import eu.teraflow.automation.acl.AclAction;
import eu.teraflow.automation.acl.AclEntry;
import eu.teraflow.automation.acl.AclForwardActionEnum;
import eu.teraflow.automation.acl.AclLogActionEnum;
import eu.teraflow.automation.acl.AclMatch;
import eu.teraflow.automation.acl.AclRuleSet;
import eu.teraflow.automation.acl.AclRuleTypeEnum;
import eu.teraflow.automation.context.model.ConfigRuleAcl;
import eu.teraflow.automation.context.model.ConfigRuleCustom;
import eu.teraflow.automation.context.model.ConfigRuleTypeAcl;
import eu.teraflow.automation.context.model.ConfigRuleTypeCustom;
import eu.teraflow.automation.context.model.EndPointId;
import eu.teraflow.automation.context.model.TopologyId;
import io.quarkus.test.junit.QuarkusTest;
import java.util.List;
import org.junit.jupiter.api.Test;
@QuarkusTest
class ConfigRuleTypeTest {
private AclMatch createAclMatch() {
return new AclMatch(1, 2, "192.168.3.52", "192.168.4.192", 3224, 3845, 5, 10);
}
private AclAction createAclAction() {
return new AclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
}
private AclEntry createAclEntry(AclMatch aclMatch, AclAction aclAction) {
return new AclEntry(1, "aclEntryDescription", aclMatch, aclAction);
}
@Test
void shouldExtractConfigRuleCustomFromConfigRuleTypeCustom() {
final var resourceKey = "resourceKey";
final var resourceValue = "resourceValue";
final var expectedConfigRuleCustom = new ConfigRuleCustom(resourceKey, resourceValue);
final var configRuleTypeCustom = new ConfigRuleTypeCustom(expectedConfigRuleCustom);
assertThat(configRuleTypeCustom.getConfigRuleType()).isEqualTo(expectedConfigRuleCustom);
}
@Test
void shouldExtractConfigRuleAclFromConfigRuleTypeAcl() {
final var contextIdUuid = "contextId";
final var topologyIdUuid = "topologyUuid";
final var deviceIdUuid = "deviceIdUuid";
final var endpointIdUuid = "endpointIdUuid";
final var topologyId = new TopologyId(contextIdUuid, topologyIdUuid);
final var endPointId = new EndPointId(topologyId, deviceIdUuid, endpointIdUuid);
final var aclMatch = createAclMatch();
final var aclAction = createAclAction();
final var aclEntry = createAclEntry(aclMatch, aclAction);
final var aclRuleSet =
new AclRuleSet(
"aclRuleName", AclRuleTypeEnum.IPV4, "AclRuleDescription", "userId", List.of(aclEntry));
final var expectedConfigRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet);
final var configRuleTypeAcl = new ConfigRuleTypeAcl(expectedConfigRuleAcl);
assertThat(configRuleTypeAcl.getConfigRuleType()).isEqualTo(expectedConfigRuleAcl);
}
}
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.teraflow.automation;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import eu.teraflow.automation.context.model.EndPoint;
import eu.teraflow.automation.context.model.EndPointId;
import eu.teraflow.automation.context.model.Location;
import eu.teraflow.automation.context.model.LocationTypeRegion;
import eu.teraflow.automation.context.model.TopologyId;
import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType;
import io.quarkus.test.junit.QuarkusTest;
import java.util.List;
import org.junit.jupiter.api.Test;
@QuarkusTest
class EndPointCreationTest {
@Test
void shouldCreateEndPointObjectGivenAllAvailableFields() {
final var expectedTopologyId = new TopologyId("contextId", "id");
final var expectedDeviceId = "expectedDeviceId";
final var expectedId = "expectedId";
final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
final var expectedEndPointType = "expectedEndPointType";
final var expectedKpiSampleTypes =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var expectedLocationType = new LocationTypeRegion("ATH");
final var expectedEndPointLocation = new Location(expectedLocationType);
final var expectedEndPoint =
new EndPoint.EndPointBuilder(
expectedEndPointId, expectedEndPointType, expectedKpiSampleTypes)
.location(expectedEndPointLocation)
.build();
assertThat(expectedEndPoint.getEndPointId()).isEqualTo(expectedEndPointId);
assertThat(expectedEndPoint.getEndPointType()).isEqualTo(expectedEndPointType);
assertThat(expectedEndPoint.getKpiSampleTypes()).isEqualTo(expectedKpiSampleTypes);
assertThat(expectedEndPoint.getEndPointLocation()).isEqualTo(expectedEndPointLocation);
}
@Test
void shouldCreateEndPointObjectGivenAllFieldsExceptFromLocation() {
final var expectedTopologyId = new TopologyId("contextId", "id");
final var expectedDeviceId = "expectedDeviceId";
final var expectedId = "expectedId";
final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
final var expectedEndPointType = "expectedEndPointType";
final var expectedKpiSampleTypes =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var expectedEndPoint =
new EndPoint.EndPointBuilder(
expectedEndPointId, expectedEndPointType, expectedKpiSampleTypes)
.build();
assertThat(expectedEndPoint.getEndPointId()).isEqualTo(expectedEndPointId);
assertThat(expectedEndPoint.getEndPointType()).isEqualTo(expectedEndPointType);
assertThat(expectedEndPoint.getKpiSampleTypes()).isEqualTo(expectedKpiSampleTypes);
}
@Test
void shouldThrowIllegalStateExceptionDuringCreationOfEndPointObjectUponMissingEndPointId() {
final var expectedEndPointType = "expectedEndPointType";
final var expectedKpiSampleTypes =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var endPoint =
new EndPoint.EndPointBuilder(null, expectedEndPointType, expectedKpiSampleTypes);
assertThatExceptionOfType(IllegalStateException.class).isThrownBy(endPoint::build);
}
@Test
void shouldThrowIllegalStateExceptionDuringCreationOfEndPointObjectUponMissingEndPointType() {
final var expectedTopologyId = new TopologyId("contextId", "id");
final var expectedDeviceId = "expectedDeviceId";
final var expectedId = "expectedId";
final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
final var expectedKpiSampleTypes =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var endPoint =
new EndPoint.EndPointBuilder(expectedEndPointId, null, expectedKpiSampleTypes);
assertThatExceptionOfType(IllegalStateException.class).isThrownBy(endPoint::build);
}
@Test
void shouldThrowIllegalStateExceptionDuringCreationOfEndPointObjectUponMissingKpiSampleTypes() {
final var expectedTopologyId = new TopologyId("contextId", "id");
final var expectedDeviceId = "expectedDeviceId";
final var expectedId = "expectedId";
final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
final var expectedEndPointType = "expectedEndPointType";
final var endPoint =
new EndPoint.EndPointBuilder(expectedEndPointId, expectedEndPointType, null);
assertThatExceptionOfType(IllegalStateException.class).isThrownBy(endPoint::build);
}
}
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.teraflow.automation;
import static org.assertj.core.api.Assertions.assertThat;
import eu.teraflow.automation.context.model.GpsPosition;
import eu.teraflow.automation.context.model.LocationTypeGpsPosition;
import eu.teraflow.automation.context.model.LocationTypeRegion;
import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Test;
@QuarkusTest
class LocationTypeTest {
@Test
void shouldExtractRegionFromLocationTypeRegion() {
final var expectedRegion = "ATH";
final var locationTypeRegion = new LocationTypeRegion(expectedRegion);
assertThat(locationTypeRegion.getLocationType()).isEqualTo(expectedRegion);
}
@Test
void shouldExtractLocationGpsPositionFromLocationTypeGpsPosition() {
final var latitude = 3.99f;
final var longitude = 77.32f;
final var expectedLocationGpsPosition = new GpsPosition(latitude, longitude);
final var locationTypeGpsPosition = new LocationTypeGpsPosition(expectedLocationGpsPosition);
assertThat(locationTypeGpsPosition.getLocationType()).isEqualTo(expectedLocationGpsPosition);
}
}
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.teraflow.automation;
import io.smallrye.config.SmallRyeConfig;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.ws.rs.Produces;
import org.eclipse.microprofile.config.Config;
public class MockAutomationConfiguration {
@Inject Config config;
@Produces
@ApplicationScoped
@io.quarkus.test.Mock
AutomationConfiguration automationConfiguration() {
return config.unwrap(SmallRyeConfig.class).getConfigMapping(AutomationConfiguration.class);
}
}
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.teraflow.automation;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import acl.Acl;
import automation.Automation;
import automation.Automation.ZtpDeviceState;
import context.ContextOuterClass;
import context.ContextOuterClass.DeviceId;
import context.ContextOuterClass.DeviceOperationalStatusEnum;
import context.ContextOuterClass.Uuid;
import eu.teraflow.automation.acl.AclAction;
import eu.teraflow.automation.acl.AclEntry;
import eu.teraflow.automation.acl.AclForwardActionEnum;
import eu.teraflow.automation.acl.AclLogActionEnum;
import eu.teraflow.automation.acl.AclMatch;
import eu.teraflow.automation.acl.AclRuleSet;
import eu.teraflow.automation.acl.AclRuleTypeEnum;
import eu.teraflow.automation.context.model.ConfigActionEnum;
import eu.teraflow.automation.context.model.ConfigRule;
import eu.teraflow.automation.context.model.ConfigRuleAcl;
import eu.teraflow.automation.context.model.ConfigRuleCustom;
import eu.teraflow.automation.context.model.ConfigRuleTypeAcl;
import eu.teraflow.automation.context.model.ConfigRuleTypeCustom;
import eu.teraflow.automation.context.model.Device;
import eu.teraflow.automation.context.model.DeviceConfig;
import eu.teraflow.automation.context.model.DeviceDriverEnum;
import eu.teraflow.automation.context.model.DeviceEvent;
import eu.teraflow.automation.context.model.DeviceOperationalStatus;
import eu.teraflow.automation.context.model.Empty;
import eu.teraflow.automation.context.model.EndPoint.EndPointBuilder;
import eu.teraflow.automation.context.model.EndPointId;
import eu.teraflow.automation.context.model.Event;
import eu.teraflow.automation.context.model.EventTypeEnum;
import eu.teraflow.automation.context.model.GpsPosition;
import eu.teraflow.automation.context.model.Location;
import eu.teraflow.automation.context.model.LocationTypeGpsPosition;
import eu.teraflow.automation.context.model.LocationTypeRegion;
import eu.teraflow.automation.context.model.TopologyId;
import eu.teraflow.automation.kpi_sample_types.model.KpiSampleType;
import eu.teraflow.automation.model.DeviceRole;
import eu.teraflow.automation.model.DeviceRoleConfig;
import eu.teraflow.automation.model.DeviceRoleId;
import eu.teraflow.automation.model.DeviceRoleType;
import eu.teraflow.automation.model.DeviceState;
import io.quarkus.test.junit.QuarkusTest;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.inject.Inject;
import kpi_sample_types.KpiSampleTypes;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
@QuarkusTest
class SerializerTest {
@Inject Serializer serializer;
private AclMatch createAclMatch(
int dscp,
int protocol,
String srcAddress,
String dstAddress,
int srcPort,
int dstPort,
int startMplsLabel,
int endMplsLabel) {
return new AclMatch(
dscp, protocol, srcAddress, dstAddress, srcPort, dstPort, startMplsLabel, endMplsLabel);
}
private AclAction createAclAction(
AclForwardActionEnum forwardActionEnum, AclLogActionEnum logActionEnum) {
return new AclAction(forwardActionEnum, logActionEnum);
}
private AclEntry createAclEntry(
int sequenceId, String description, AclMatch aclMatch, AclAction aclAction) {
return new AclEntry(sequenceId, description, aclMatch, aclAction);
}
@Test
void shouldSerializeDeviceId() {
final var expectedDeviceId = "expectedDeviceId";
final var deviceIdUuid = serializer.serializeUuid(expectedDeviceId);
final var deviceId =
ContextOuterClass.DeviceId.newBuilder().setDeviceUuid(deviceIdUuid).build();
final var serializedDeviceId = serializer.serializeDeviceId(expectedDeviceId);
assertThat(serializedDeviceId).usingRecursiveComparison().isEqualTo(deviceId);
}
@Test
void shouldDeserializeDeviceId() {
final var expectedDeviceId = "expectedDeviceId";
final var serializedDeviceIdUuid = serializer.serializeUuid("expectedDeviceId");
final var serializedDeviceId =
DeviceId.newBuilder().setDeviceUuid(serializedDeviceIdUuid).build();
final var deviceId = serializer.deserialize(serializedDeviceId);
assertThat(deviceId).isEqualTo(expectedDeviceId);
}
@Test
void shouldSerializeDeviceRoleId() {
final var expectedDevRoleId = "expectedDevRoleId";
final var expectedDeviceId = "expectedDeviceId";
final var deviceRoleId = new DeviceRoleId(expectedDevRoleId, expectedDeviceId);
final var serializedDeviceRoleIdUuid = serializer.serializeUuid(expectedDevRoleId);
final var serializedDeviceRoleDeviceIdUuid = serializer.serializeUuid(expectedDeviceId);
final var serializedDeviceRoleDeviceId =
ContextOuterClass.DeviceId.newBuilder()
.setDeviceUuid(serializedDeviceRoleDeviceIdUuid)
.build();
final var expectedDeviceRoleId =
Automation.DeviceRoleId.newBuilder()
.setDevRoleId(serializedDeviceRoleIdUuid)
.setDevId(serializedDeviceRoleDeviceId)
.build();
final var serializedDevRoleId = serializer.serialize(deviceRoleId);
assertThat(serializedDevRoleId).usingRecursiveComparison().isEqualTo(expectedDeviceRoleId);
}
@Test
void shouldDeserializeDeviceRoleId() {
final var expectedDevRoleId = "expectedDevRoleId";
final var expectedDeviceId = "expectedDeviceId";
final var expectedDeviceRoleId = new DeviceRoleId(expectedDevRoleId, expectedDeviceId);
final var serializedDeviceRoleId = serializer.serialize(expectedDeviceRoleId);
final var deviceRoleId = serializer.deserialize(serializedDeviceRoleId);
assertThat(deviceRoleId).usingRecursiveComparison().isEqualTo(expectedDeviceRoleId);
}
private static Stream<Arguments> provideDeviceRoleType() {
return Stream.of(
Arguments.of(DeviceRoleType.DEV_OPS, Automation.DeviceRoleType.DEV_OPS),
Arguments.of(DeviceRoleType.DEV_CONF, Automation.DeviceRoleType.DEV_CONF),
Arguments.of(DeviceRoleType.NONE, Automation.DeviceRoleType.NONE),
Arguments.of(DeviceRoleType.PIPELINE_CONF, Automation.DeviceRoleType.PIPELINE_CONF));
}
@ParameterizedTest
@MethodSource("provideDeviceRoleType")
void shouldSerializeDeviceRoleType(
DeviceRoleType deviceRoleType, Automation.DeviceRoleType expectedSerializedType) {
final var serializedType = serializer.serialize(deviceRoleType);
assertThat(serializedType.getNumber()).isEqualTo(expectedSerializedType.getNumber());
}
@ParameterizedTest
@MethodSource("provideDeviceRoleType")
void shouldDeserializeDeviceRoleType(
DeviceRoleType expectedDeviceRoleType,
Automation.DeviceRoleType serializedDeviceRoleTypeType) {
final var deviceRoleType = serializer.deserialize(serializedDeviceRoleTypeType);
assertThat(deviceRoleType).isEqualTo(expectedDeviceRoleType);
}
@Test
void shouldSerializeDeviceRole() {
final var expectedDevRoleId = "expectedDevRoleId";
final var expectedDeviceId = "expectedDeviceId";
final var serializedDeviceRoleDevRoleIdUuid = serializer.serializeUuid(expectedDevRoleId);
final var serializedDeviceRoleDeviceId = serializer.serializeDeviceId(expectedDeviceId);
final var expectedDeviceRoleId =
Automation.DeviceRoleId.newBuilder()
.setDevRoleId(serializedDeviceRoleDevRoleIdUuid)
.setDevId(serializedDeviceRoleDeviceId)
.build();
final var expectedDeviceRoleType = Automation.DeviceRoleType.PIPELINE_CONF;
final var expectedDeviceRole =
Automation.DeviceRole.newBuilder()
.setDevRoleId(expectedDeviceRoleId)
.setDevRoleType(expectedDeviceRoleType)
.build();
final var deviceRoleId = new DeviceRoleId(expectedDevRoleId, expectedDeviceId);
final var deviceRoleType = DeviceRoleType.PIPELINE_CONF;
final var deviceRole = new DeviceRole(deviceRoleId, deviceRoleType);
final var serializedDeviceRole = serializer.serialize(deviceRole);
assertThat(serializedDeviceRole).usingRecursiveComparison().isEqualTo(expectedDeviceRole);
}
@Test
void shouldDeserializeDeviceRole() {
final var expectedDevRoleId = "expectedDevRoleId";
final var expectedDeviceId = "expectedDeviceId";
final var expectedDeviceRoleId = new DeviceRoleId(expectedDevRoleId, expectedDeviceId);
final var expectedDeviceRoleType = DeviceRoleType.NONE;
final var expectedDeviceRole = new DeviceRole(expectedDeviceRoleId, expectedDeviceRoleType);
final var serializedDeviceRoleId = serializer.serialize(expectedDeviceRoleId);
final var serializedDeviceRoleType = serializer.serialize(expectedDeviceRoleType);
final var serializedDeviceRole =
Automation.DeviceRole.newBuilder()
.setDevRoleId(serializedDeviceRoleId)
.setDevRoleType(serializedDeviceRoleType)
.build();
final var deviceRole = serializer.deserialize(serializedDeviceRole);
assertThat(deviceRole).usingRecursiveComparison().isEqualTo(expectedDeviceRole);
}
@Test
void shouldSerializeDeviceRoleConfig() {
final var expectedDevRoleId = new DeviceRoleId("expectedDevRoleId", "expectedDeviceId");
final var expectedDevRoleType = DeviceRoleType.DEV_OPS;
final var deviceRole = new DeviceRole(expectedDevRoleId, expectedDevRoleType);
final var serializedDeviceRole = serializer.serialize(deviceRole);
final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA);
final var deviceConfig =
new DeviceConfig(List.of(new ConfigRule(ConfigActionEnum.SET, configRuleTypeA)));
final var serializedDeviceConfig = serializer.serialize(deviceConfig);
final var expectedDeviceRoleConfig =
Automation.DeviceRoleConfig.newBuilder()
.setDevRole(serializedDeviceRole)
.setDevConfig(serializedDeviceConfig)
.build();
final var deviceRoleConfig = new DeviceRoleConfig(deviceRole, deviceConfig);
final var serializedDeviceRoleConfig = serializer.serialize(deviceRoleConfig);
assertThat(serializedDeviceRoleConfig)
.usingRecursiveComparison()
.isEqualTo(expectedDeviceRoleConfig);
}
@Test
void shouldDeserializeDeviceRoleConfig() {
final var expectedDevRoleId = new DeviceRoleId("expectedDevRoleId", "expectedDeviceId");
final var expectedDevRoleType = DeviceRoleType.DEV_OPS;
final var deviceRole = new DeviceRole(expectedDevRoleId, expectedDevRoleType);
final var serializedDeviceRole = serializer.serialize(deviceRole);
final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA);
final var deviceConfig =
new DeviceConfig(List.of(new ConfigRule(ConfigActionEnum.SET, configRuleTypeA)));
final var serializedDeviceConfig = serializer.serialize(deviceConfig);
final var expectedDeviceRoleConfig = new DeviceRoleConfig(deviceRole, deviceConfig);
final var serializedDeviceRoleConfig =
Automation.DeviceRoleConfig.newBuilder()
.setDevRole(serializedDeviceRole)
.setDevConfig(serializedDeviceConfig)
.build();
final var deviceRoleConfig = serializer.deserialize(serializedDeviceRoleConfig);
assertThat(deviceRoleConfig).usingRecursiveComparison().isEqualTo(expectedDeviceRoleConfig);
}
private static Stream<Arguments> provideEventTypeEnum() {
return Stream.of(
Arguments.of(EventTypeEnum.CREATE, ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE),
Arguments.of(EventTypeEnum.REMOVE, ContextOuterClass.EventTypeEnum.EVENTTYPE_REMOVE),
Arguments.of(EventTypeEnum.UNDEFINED, ContextOuterClass.EventTypeEnum.EVENTTYPE_UNDEFINED),
Arguments.of(EventTypeEnum.UPDATE, ContextOuterClass.EventTypeEnum.EVENTTYPE_UPDATE));
}
@ParameterizedTest
@MethodSource("provideEventTypeEnum")
void shouldSerializeEventType(
EventTypeEnum eventType, ContextOuterClass.EventTypeEnum expectedSerializedType) {
final var serializedType = serializer.serialize(eventType);
assertThat(serializedType.getNumber()).isEqualTo(expectedSerializedType.getNumber());
}
@ParameterizedTest
@MethodSource("provideEventTypeEnum")
void shouldDeserializeEventType(
EventTypeEnum expectedEventType, ContextOuterClass.EventTypeEnum serializedEventType) {
final var eventType = serializer.deserialize(serializedEventType);
assertThat(eventType).isEqualTo(expectedEventType);
}
private static Stream<Arguments> provideDeviceState() {
return Stream.of(
Arguments.of(DeviceState.CREATED, ZtpDeviceState.ZTP_DEV_STATE_CREATED),
Arguments.of(DeviceState.UPDATED, ZtpDeviceState.ZTP_DEV_STATE_UPDATED),
Arguments.of(DeviceState.DELETED, ZtpDeviceState.ZTP_DEV_STATE_DELETED),
Arguments.of(DeviceState.UNDEFINED, ZtpDeviceState.ZTP_DEV_STATE_UNDEFINED));
}
@ParameterizedTest
@MethodSource("provideDeviceState")
void shouldSerializeDeviceState(
DeviceState deviceState, ZtpDeviceState expectedSerializedDeviceState) {
final var serializedDeviceState = serializer.serialize(deviceState);
assertThat(serializedDeviceState.getNumber())
.isEqualTo(expectedSerializedDeviceState.getNumber());
}
@ParameterizedTest
@MethodSource("provideDeviceState")
void shouldDeserializeDeviceState(
DeviceState expectedDeviceState, ZtpDeviceState serializedDeviceState) {
final var deviceState = serializer.deserialize(serializedDeviceState);
assertThat(deviceState).isEqualTo(expectedDeviceState);
}
@Test
void shouldSerializeEvent() {
final var timestamp = ContextOuterClass.Timestamp.newBuilder().setTimestamp(1).build();
final var expectedEvent =
ContextOuterClass.Event.newBuilder()
.setTimestamp(timestamp)
.setEventType(ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE)
.build();
final var event = new Event(1, EventTypeEnum.CREATE);
final var serializedEvent = serializer.serialize(event);
assertThat(serializedEvent).usingRecursiveComparison().isEqualTo(expectedEvent);
}
@Test
void shouldDeserializeEvent() {
final var expectedEvent = new Event(1, EventTypeEnum.CREATE);
final var timestamp = ContextOuterClass.Timestamp.newBuilder().setTimestamp(1).build();
final var serializedEvent =
ContextOuterClass.Event.newBuilder()
.setTimestamp(timestamp)
.setEventType(ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE)
.build();
final var event = serializer.deserialize(serializedEvent);
assertThat(event).usingRecursiveComparison().isEqualTo(expectedEvent);
}
@Test
void shouldSerializeDeviceEvent() {
final var expectedUuid = Uuid.newBuilder().setUuid("deviceId");
final var expectedDeviceId = DeviceId.newBuilder().setDeviceUuid(expectedUuid).build();
final var expectedTimestamp = ContextOuterClass.Timestamp.newBuilder().setTimestamp(1).build();
final var expectedEvent =
ContextOuterClass.Event.newBuilder()
.setTimestamp(expectedTimestamp)
.setEventType(ContextOuterClass.EventTypeEnum.EVENTTYPE_CREATE)
.build();
final var expectedConfigRuleCustomA =
ContextOuterClass.ConfigRule_Custom.newBuilder()
.setResourceKey("resourceKeyA")
.setResourceValue("resourceValueA")
.build();
final var expectedConfigRuleCustomB =
ContextOuterClass.ConfigRule_Custom.newBuilder()
.setResourceKey("resourceKeyB")
.setResourceValue("resourceValueB")
.build();
final var expectedConfigRuleA =
ContextOuterClass.ConfigRule.newBuilder()
.setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET)
.setCustom(expectedConfigRuleCustomA)
.build();
final var expectedConfigRuleB =
ContextOuterClass.ConfigRule.newBuilder()
.setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE)
.setCustom(expectedConfigRuleCustomB)
.build();
final var expectedDeviceConfig =
ContextOuterClass.DeviceConfig.newBuilder()
.addAllConfigRules(List.of(expectedConfigRuleA, expectedConfigRuleB))
.build();
final var expectedDeviceEvent =
ContextOuterClass.DeviceEvent.newBuilder()
.setDeviceId(expectedDeviceId)
.setEvent(expectedEvent)
.setDeviceConfig(expectedDeviceConfig)
.build();
final var creationEvent = new Event(1, EventTypeEnum.CREATE);
final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
final var configRuleCustomB = new ConfigRuleCustom("resourceKeyB", "resourceValueB");
final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA);
final var configRuleTypeB = new ConfigRuleTypeCustom(configRuleCustomB);
final var configRuleA = new ConfigRule(ConfigActionEnum.SET, configRuleTypeA);
final var configRuleB = new ConfigRule(ConfigActionEnum.DELETE, configRuleTypeB);
final var deviceConfig = new DeviceConfig(List.of(configRuleA, configRuleB));
final var deviceEvent = new DeviceEvent("deviceId", creationEvent, deviceConfig);
final var serializedDeviceEvent = serializer.serialize(deviceEvent);
assertThat(serializedDeviceEvent).usingRecursiveComparison().isEqualTo(expectedDeviceEvent);
}
@Test
void shouldDeserializeDeviceEvent() {
final var dummyDeviceId = "deviceId";
final var expectedEventType = EventTypeEnum.REMOVE;
final var expectedTimestamp = ContextOuterClass.Timestamp.newBuilder().setTimestamp(1).build();
final var creationEvent = new Event(1, expectedEventType);
final var expectedConfigRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
final var expectedConfigRuleCustomB = new ConfigRuleCustom("resourceKeyB", "resourceValueB");
final var expectedConfigRuleTypeA = new ConfigRuleTypeCustom(expectedConfigRuleCustomA);
final var expectedConfigRuleTypeB = new ConfigRuleTypeCustom(expectedConfigRuleCustomB);
final var expectedConfigRuleA = new ConfigRule(ConfigActionEnum.SET, expectedConfigRuleTypeA);
final var expectedConfigRuleB =
new ConfigRule(ConfigActionEnum.DELETE, expectedConfigRuleTypeB);
final var expectedDeviceConfig =
new DeviceConfig(List.of(expectedConfigRuleA, expectedConfigRuleB));
final var expectedDeviceEvent =
new DeviceEvent(dummyDeviceId, creationEvent, expectedDeviceConfig);
final var deviceUuid = Uuid.newBuilder().setUuid("deviceId");
final var deviceId = DeviceId.newBuilder().setDeviceUuid(deviceUuid).build();
final var event =
ContextOuterClass.Event.newBuilder()
.setTimestamp(expectedTimestamp)
.setEventType(ContextOuterClass.EventTypeEnum.EVENTTYPE_REMOVE)
.build();
final var configRuleCustomA =
ContextOuterClass.ConfigRule_Custom.newBuilder()
.setResourceKey("resourceKeyA")
.setResourceValue("resourceValueA")
.build();
final var configRuleCustomB =
ContextOuterClass.ConfigRule_Custom.newBuilder()
.setResourceKey("resourceKeyB")
.setResourceValue("resourceValueB")
.build();
final var configRuleA =
ContextOuterClass.ConfigRule.newBuilder()
.setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET)
.setCustom(configRuleCustomA)
.build();
final var configRuleB =
ContextOuterClass.ConfigRule.newBuilder()
.setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE)
.setCustom(configRuleCustomB)
.build();
final var deviceConfig =
ContextOuterClass.DeviceConfig.newBuilder()
.addAllConfigRules(List.of(configRuleA, configRuleB))
.build();
final var serializedDeviceEvent =
ContextOuterClass.DeviceEvent.newBuilder()
.setDeviceId(deviceId)
.setEvent(event)
.setDeviceConfig(deviceConfig)
.build();
final var deviceEvent = serializer.deserialize(serializedDeviceEvent);
assertThat(deviceEvent).usingRecursiveComparison().isEqualTo(expectedDeviceEvent);
}
private static Stream<Arguments> provideConfigActionEnum() {
return Stream.of(
Arguments.of(ConfigActionEnum.SET, ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET),
Arguments.of(
ConfigActionEnum.DELETE, ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE),
Arguments.of(
ConfigActionEnum.UNDEFINED, ContextOuterClass.ConfigActionEnum.CONFIGACTION_UNDEFINED));
}
@ParameterizedTest
@MethodSource("provideConfigActionEnum")
void shouldSerializeConfigActionEnum(
ConfigActionEnum configAction, ContextOuterClass.ConfigActionEnum expectedConfigAction) {
final var serializedConfigAction = serializer.serialize(configAction);
assertThat(serializedConfigAction.getNumber()).isEqualTo(expectedConfigAction.getNumber());
}
@ParameterizedTest
@MethodSource("provideConfigActionEnum")
void shouldDeserializeConfigActionEnum(
ConfigActionEnum expectedConfigAction,
ContextOuterClass.ConfigActionEnum serializedConfigAction) {
final var configAction = serializer.deserialize(serializedConfigAction);
assertThat(configAction).isEqualTo(expectedConfigAction);
}
private static Stream<Arguments> provideAclRuleTypeEnum() {
return Stream.of(
Arguments.of(AclRuleTypeEnum.IPV4, Acl.AclRuleTypeEnum.ACLRULETYPE_IPV4),
Arguments.of(AclRuleTypeEnum.IPV6, Acl.AclRuleTypeEnum.ACLRULETYPE_IPV6),
Arguments.of(AclRuleTypeEnum.L2, Acl.AclRuleTypeEnum.ACLRULETYPE_L2),
Arguments.of(AclRuleTypeEnum.MPLS, Acl.AclRuleTypeEnum.ACLRULETYPE_MPLS),
Arguments.of(AclRuleTypeEnum.MIXED, Acl.AclRuleTypeEnum.ACLRULETYPE_MIXED),
Arguments.of(AclRuleTypeEnum.UNDEFINED, Acl.AclRuleTypeEnum.ACLRULETYPE_UNDEFINED));
}
@ParameterizedTest
@MethodSource("provideAclRuleTypeEnum")
void shouldSerializeAclRuleTypeEnum(
AclRuleTypeEnum aclRuleTypeEnum, Acl.AclRuleTypeEnum expectedAclRuleTypeEnum) {
final var serializedAclRuleTypeEnum = serializer.serialize(aclRuleTypeEnum);
assertThat(serializedAclRuleTypeEnum.getNumber())
.isEqualTo(expectedAclRuleTypeEnum.getNumber());
}
@ParameterizedTest
@MethodSource("provideAclRuleTypeEnum")
void shouldDeserializeAclRuleTypeEnum(
AclRuleTypeEnum expectedAclRuleTypeEnum, Acl.AclRuleTypeEnum serializedAclRuleTypeEnum) {
final var aclRuleTypeEnum = serializer.deserialize(serializedAclRuleTypeEnum);
assertThat(aclRuleTypeEnum).isEqualTo(expectedAclRuleTypeEnum);
}
private static Stream<Arguments> provideAclForwardActionEnum() {
return Stream.of(
Arguments.of(AclForwardActionEnum.DROP, Acl.AclForwardActionEnum.ACLFORWARDINGACTION_DROP),
Arguments.of(
AclForwardActionEnum.ACCEPT, Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT),
Arguments.of(
AclForwardActionEnum.REJECT, Acl.AclForwardActionEnum.ACLFORWARDINGACTION_REJECT),
Arguments.of(
AclForwardActionEnum.UNDEFINED,
Acl.AclForwardActionEnum.ACLFORWARDINGACTION_UNDEFINED));
}
@ParameterizedTest
@MethodSource("provideAclForwardActionEnum")
void shouldSerializeAclForwardActionEnum(
AclForwardActionEnum aclForwardActionEnum,
Acl.AclForwardActionEnum expectedAclForwardActionEnum) {
final var serializedAclForwardActionEnum = serializer.serialize(aclForwardActionEnum);
assertThat(serializedAclForwardActionEnum.getNumber())
.isEqualTo(expectedAclForwardActionEnum.getNumber());
}
@ParameterizedTest
@MethodSource("provideAclForwardActionEnum")
void shouldDeserializeAclForwardActionEnum(
AclForwardActionEnum expectedAclForwardActionEnum,
Acl.AclForwardActionEnum serializedAclForwardActionEnum) {
final var aclForwardActionEnum = serializer.deserialize(serializedAclForwardActionEnum);
assertThat(aclForwardActionEnum).isEqualTo(expectedAclForwardActionEnum);
}
private static Stream<Arguments> provideAclLogActionEnum() {
return Stream.of(
Arguments.of(AclLogActionEnum.NO_LOG, Acl.AclLogActionEnum.ACLLOGACTION_NOLOG),
Arguments.of(AclLogActionEnum.SYSLOG, Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG),
Arguments.of(AclLogActionEnum.UNDEFINED, Acl.AclLogActionEnum.ACLLOGACTION_UNDEFINED));
}
@ParameterizedTest
@MethodSource("provideAclLogActionEnum")
void shouldSerializeAclLogActionEnum(
AclLogActionEnum aclLogActionEnum, Acl.AclLogActionEnum expectedAclLogActionEnum) {
final var serializedAclLogActionEnum = serializer.serialize(aclLogActionEnum);
assertThat(serializedAclLogActionEnum.getNumber())
.isEqualTo(expectedAclLogActionEnum.getNumber());
}
@Test
void shouldSerializeAclAction() {
final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
final var expectedAclAction =
Acl.AclAction.newBuilder()
.setForwardAction(Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT)
.setLogAction(Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG)
.build();
final var serializedAclAction = serializer.serialize(aclAction);
assertThat(serializedAclAction).usingRecursiveComparison().isEqualTo(expectedAclAction);
}
@Test
void shouldDeserializeAclAction() {
final var expectedAclAction =
createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
final var serializedAclAction = serializer.serialize(expectedAclAction);
final var aclAction = serializer.deserialize(serializedAclAction);
assertThat(aclAction).usingRecursiveComparison().isEqualTo(expectedAclAction);
}
@Test
void shouldSerializeAclMatch() {
final var aclMatch = createAclMatch(1, 1, "127.0.0.1", "127.0.0.2", 5601, 5602, 1, 2);
final var expectedAclMatch =
Acl.AclMatch.newBuilder()
.setDscp(1)
.setProtocol(1)
.setSrcAddress("127.0.0.1")
.setDstAddress("127.0.0.2")
.setSrcPort(5601)
.setDstPort(5602)
.setStartMplsLabel(1)
.setEndMplsLabel(2)
.build();
final var serializedAclMatch = serializer.serialize(aclMatch);
assertThat(serializedAclMatch).usingRecursiveComparison().isEqualTo(expectedAclMatch);
}
@Test
void shouldDeserializeAclMatch() {
final var expectedAclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10);
final var serializedAclMatch = serializer.serialize(expectedAclMatch);
final var aclMatch = serializer.deserialize(serializedAclMatch);
assertThat(aclMatch).usingRecursiveComparison().isEqualTo(expectedAclMatch);
}
@Test
void shouldSerializeAclEntry() {
final var sequenceId = 1;
final var description = "aclEntryDescription";
final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10);
final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
final var aclEntry = createAclEntry(sequenceId, description, aclMatch, aclAction);
final var serializedAclMatch = serializer.serialize(aclMatch);
final var serializedAclAction = serializer.serialize(aclAction);
final var expectedAclEntry =
Acl.AclEntry.newBuilder()
.setSequenceId(sequenceId)
.setDescription(description)
.setMatch(serializedAclMatch)
.setAction(serializedAclAction)
.build();
final var serializedAclEntry = serializer.serialize(aclEntry);
assertThat(serializedAclEntry).usingRecursiveComparison().isEqualTo(expectedAclEntry);
}
@Test
void shouldDeserializeAclEntry() {
final var sequenceId = 1;
final var description = "aclEntryDescription";
final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10);
final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
final var expectedAclEntry = createAclEntry(sequenceId, description, aclMatch, aclAction);
final var serializedAclEntry = serializer.serialize(expectedAclEntry);
final var aclEntry = serializer.deserialize(serializedAclEntry);
assertThat(aclEntry).usingRecursiveComparison().isEqualTo(expectedAclEntry);
}
@Test
void shouldSerializeAclRuleSet() {
final var sequenceId = 1;
final var aclEntryDescription = "aclEntryDescription";
final var aclRuleSetName = "aclRuleSetName";
final var aclRuleSetDescription = "aclRuleSetDescription";
final var aclRuleSetUserId = "aclRuleSetUserId";
final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10);
final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
final var aclEntry = createAclEntry(sequenceId, aclEntryDescription, aclMatch, aclAction);
final var aclRuleSet =
new AclRuleSet(
aclRuleSetName,
AclRuleTypeEnum.MIXED,
aclRuleSetDescription,
aclRuleSetUserId,
List.of(aclEntry));
final var serializedAclEntry = serializer.serialize(aclEntry);
final var serializedAclEntries = List.of(serializedAclEntry);
final var expectedAclRuleSet =
Acl.AclRuleSet.newBuilder()
.setName(aclRuleSetName)
.setType(Acl.AclRuleTypeEnum.ACLRULETYPE_MIXED)
.setDescription(aclRuleSetDescription)
.setUserId(aclRuleSetUserId)
.addAllEntries(serializedAclEntries)
.build();
final var serializedAclRuleset = serializer.serialize(aclRuleSet);
assertThat(serializedAclRuleset).usingRecursiveComparison().isEqualTo(expectedAclRuleSet);
}
@Test
void shouldDeserializeAclRuleSet() {
final var sequenceId = 1;
final var aclEntryDescription = "aclEntryDescription";
final var aclRuleSetName = "aclRuleSetName";
final var aclRuleSetDescription = "aclRuleSetDescription";
final var aclRuleSetUserId = "aclRuleSetUserId";
final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10);
final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
final var aclEntry = createAclEntry(sequenceId, aclEntryDescription, aclMatch, aclAction);
final var expectedAclRuleSet =
new AclRuleSet(
aclRuleSetName,
AclRuleTypeEnum.MIXED,
aclRuleSetDescription,
aclRuleSetUserId,
List.of(aclEntry));
final var serializedAclRuleSet = serializer.serialize(expectedAclRuleSet);
final var aclRuleSet = serializer.deserialize(serializedAclRuleSet);
assertThat(aclRuleSet).usingRecursiveComparison().isEqualTo(expectedAclRuleSet);
}
@ParameterizedTest
@MethodSource("provideAclLogActionEnum")
void shouldDeserializeAclLogActionEnum(
AclLogActionEnum expectedAclLogActionEnum, Acl.AclLogActionEnum serializedAclLogActionEnum) {
final var aclLogActionEnum = serializer.deserialize(serializedAclLogActionEnum);
assertThat(aclLogActionEnum).isEqualTo(expectedAclLogActionEnum);
}
@Test
void shouldSerializeTopologyId() {
final var expectedContextId = "expectedContextId";
final var expectedId = "expectedId";
final var topologyId = new TopologyId(expectedContextId, expectedId);
final var serializedContextId = serializer.serializeContextId(expectedContextId);
final var serializedIdUuid = serializer.serializeUuid(expectedId);
final var expectedTopologyId =
ContextOuterClass.TopologyId.newBuilder()
.setContextId(serializedContextId)
.setTopologyUuid(serializedIdUuid)
.build();
final var serializedTopologyId = serializer.serialize(topologyId);
assertThat(serializedTopologyId).usingRecursiveComparison().isEqualTo(expectedTopologyId);
}
@Test
void shouldDeserializeTopologyId() {
final var expectedContextId = "expectedContextId";
final var expectedId = "expectedId";
final var expectedTopologyId = new TopologyId(expectedContextId, expectedId);
final var serializedTopologyId = serializer.serialize(expectedTopologyId);
final var topologyId = serializer.deserialize(serializedTopologyId);
assertThat(topologyId).usingRecursiveComparison().isEqualTo(expectedTopologyId);
}
@Test
void shouldSerializeEndPointId() {
final var expectedTopologyId = new TopologyId("contextId", "id");
final var expectedDeviceId = "expectedDeviceId";
final var expectedId = "expectedId";
final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
final var serializedTopologyId = serializer.serialize(expectedTopologyId);
final var serializedDeviceId = serializer.serializeDeviceId(expectedDeviceId);
final var serializedEndPointUuid = serializer.serializeUuid(expectedId);
final var expectedEndPointId =
ContextOuterClass.EndPointId.newBuilder()
.setTopologyId(serializedTopologyId)
.setDeviceId(serializedDeviceId)
.setEndpointUuid(serializedEndPointUuid)
.build();
final var serializedEndPointId = serializer.serialize(endPointId);
assertThat(serializedEndPointId).usingRecursiveComparison().isEqualTo(expectedEndPointId);
}
@Test
void shouldDeserializeEndPointId() {
final var expectedTopologyId = new TopologyId("contextId", "id");
final var expectedDeviceId = "expectedDeviceId";
final var expectedId = "expectedId";
final var expectedEndPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
final var serializedEndPointId = serializer.serialize(expectedEndPointId);
final var endPointId = serializer.deserialize(serializedEndPointId);
assertThat(endPointId).usingRecursiveComparison().isEqualTo(expectedEndPointId);
}
@Test
void shouldSerializeConfigRuleAcl() {
final var expectedTopologyId = new TopologyId("contextId", "id");
final var expectedDeviceId = "expectedDeviceId";
final var expectedId = "expectedId";
final var sequenceId = 1;
final var aclEntryDescription = "aclEntryDescription";
final var aclRuleSetName = "aclRuleSetName";
final var aclRuleSetDescription = "aclRuleSetDescription";
final var aclRuleSetUserId = "aclRuleSetUserId";
final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10);
final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
final var aclEntry = createAclEntry(sequenceId, aclEntryDescription, aclMatch, aclAction);
final var aclRuleSet =
new AclRuleSet(
aclRuleSetName,
AclRuleTypeEnum.MIXED,
aclRuleSetDescription,
aclRuleSetUserId,
List.of(aclEntry));
final var configRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet);
final var serializedEndPointId = serializer.serialize(endPointId);
final var serializedAclRuleSet = serializer.serialize(aclRuleSet);
final var expectedConfigRuleAcl =
ContextOuterClass.ConfigRule_ACL.newBuilder()
.setEndpointId(serializedEndPointId)
.setRuleSet(serializedAclRuleSet)
.build();
final var serializedConfigRuleAcl = serializer.serialize(configRuleAcl);
assertThat(serializedConfigRuleAcl).usingRecursiveComparison().isEqualTo(expectedConfigRuleAcl);
}
@Test
void shouldDeserializeConfigRuleAcl() {
final var expectedTopologyId = new TopologyId("contextId", "id");
final var expectedDeviceId = "expectedDeviceId";
final var expectedId = "expectedId";
final var sequenceId = 1;
final var aclEntryDescription = "aclEntryDescription";
final var aclRuleSetName = "aclRuleSetName";
final var aclRuleSetDescription = "aclRuleSetDescription";
final var aclRuleSetUserId = "aclRuleSetUserId";
final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10);
final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
final var aclEntry = createAclEntry(sequenceId, aclEntryDescription, aclMatch, aclAction);
final var aclRuleSet =
new AclRuleSet(
aclRuleSetName,
AclRuleTypeEnum.MIXED,
aclRuleSetDescription,
aclRuleSetUserId,
List.of(aclEntry));
final var expectedConfigRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet);
final var serializedConfigRuleAcl = serializer.serialize(expectedConfigRuleAcl);
final var configRuleAcl = serializer.deserialize(serializedConfigRuleAcl);
assertThat(configRuleAcl).usingRecursiveComparison().isEqualTo(expectedConfigRuleAcl);
}
@Test
void shouldSerializeConfigRuleCustom() {
final var resourceKey = "resourceKey";
final var resourceValue = "resourceValue";
final var configRuleCustom = new ConfigRuleCustom(resourceKey, resourceValue);
final var expectedConfigRuleCustom =
ContextOuterClass.ConfigRule_Custom.newBuilder()
.setResourceKey(resourceKey)
.setResourceValue(resourceValue)
.build();
final var serializedConfigRuleCustom = serializer.serialize(configRuleCustom);
assertThat(serializedConfigRuleCustom)
.usingRecursiveComparison()
.isEqualTo(expectedConfigRuleCustom);
}
@Test
void shouldDeserializeConfigRuleCustom() {
final var resourceKey = "resourceKey";
final var resourceValue = "resourceValue";
final var expectedConfigRuleCustom = new ConfigRuleCustom(resourceKey, resourceValue);
final var serializedConfigRuleCustom = serializer.serialize(expectedConfigRuleCustom);
final var configRuleCustom = serializer.deserialize(serializedConfigRuleCustom);
assertThat(configRuleCustom).usingRecursiveComparison().isEqualTo(expectedConfigRuleCustom);
}
@Test
void shouldSerializeConfigRule() {
final var contextIdUuid = "contextId";
final var topologyIdUuid = "topologyUuid";
final var deviceIdUuid = "deviceIdUuid";
final var endpointIdUuid = "endpointIdUuid";
final var expectedSerializedContextId = serializer.serializeContextId(contextIdUuid);
final var expectedSerializedTopologyIdUuid = serializer.serializeUuid(topologyIdUuid);
final var expectedSerializedDeviceId = serializer.serializeDeviceId(deviceIdUuid);
final var expectedSerializedEndPointIdUuid = serializer.serializeUuid(endpointIdUuid);
final var expectedSerializedTopologyId =
ContextOuterClass.TopologyId.newBuilder()
.setContextId(expectedSerializedContextId)
.setTopologyUuid(expectedSerializedTopologyIdUuid)
.build();
final var topologyId = new TopologyId(contextIdUuid, topologyIdUuid);
final var expectedSerializedEndPointId =
ContextOuterClass.EndPointId.newBuilder()
.setTopologyId(expectedSerializedTopologyId)
.setDeviceId(expectedSerializedDeviceId)
.setEndpointUuid(expectedSerializedEndPointIdUuid)
.build();
final var endPointId = new EndPointId(topologyId, deviceIdUuid, endpointIdUuid);
final var expectedSerializedAclMatch =
Acl.AclMatch.newBuilder()
.setDscp(1)
.setProtocol(1)
.setSrcAddress("127.0.0.1")
.setDstAddress("127.0.0.2")
.setSrcPort(5601)
.setDstPort(5602)
.setStartMplsLabel(1)
.setEndMplsLabel(2)
.build();
final var aclMatch = createAclMatch(1, 1, "127.0.0.1", "127.0.0.2", 5601, 5602, 1, 2);
final var expectedSerializedAclAction =
Acl.AclAction.newBuilder()
.setForwardAction(Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT)
.setLogAction(Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG)
.build();
final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
final var expectedSerializedAclEntry =
Acl.AclEntry.newBuilder()
.setSequenceId(1)
.setDescription("aclEntryDescription")
.setMatch(expectedSerializedAclMatch)
.setAction(expectedSerializedAclAction)
.build();
final var aclEntry = createAclEntry(1, "aclEntryDescription", aclMatch, aclAction);
final var expectedSerializedAclRuleSet =
Acl.AclRuleSet.newBuilder()
.setName("aclRuleName")
.setType(Acl.AclRuleTypeEnum.ACLRULETYPE_IPV4)
.setDescription("AclRuleDescription")
.setUserId("userId")
.addEntries(expectedSerializedAclEntry)
.build();
final var aclRuleSet =
new AclRuleSet(
"aclRuleName",
eu.teraflow.automation.acl.AclRuleTypeEnum.IPV4,
"AclRuleDescription",
"userId",
List.of(aclEntry));
final var expectedSerializedConfigRuleAcl =
ContextOuterClass.ConfigRule_ACL.newBuilder()
.setEndpointId(expectedSerializedEndPointId)
.setRuleSet(expectedSerializedAclRuleSet)
.build();
final var configRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet);
final var expectedConfigRule =
ContextOuterClass.ConfigRule.newBuilder()
.setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET)
.setAcl(expectedSerializedConfigRuleAcl)
.build();
final var configRuleTypeAcl = new ConfigRuleTypeAcl(configRuleAcl);
final var configRule = new ConfigRule(ConfigActionEnum.SET, configRuleTypeAcl);
final var serializedConfigRule = serializer.serialize(configRule);
assertThat(serializedConfigRule).isEqualTo(expectedConfigRule);
}
@Test
void shouldDeserializeConfigRule() {
final var contextIdUuid = "contextId";
final var topologyIdUuid = "topologyUuid";
final var deviceIdUuid = "deviceIdUuid";
final var endpointIdUuid = "endpointIdUuid";
final var serializedContextId = serializer.serializeContextId(contextIdUuid);
final var serializedTopologyIdUuid = serializer.serializeUuid(topologyIdUuid);
final var serializedDeviceId = serializer.serializeDeviceId(deviceIdUuid);
final var serializedEndPointIdUuid = serializer.serializeUuid(endpointIdUuid);
final var topologyId = new TopologyId(contextIdUuid, topologyIdUuid);
final var serializedTopologyId =
ContextOuterClass.TopologyId.newBuilder()
.setContextId(serializedContextId)
.setTopologyUuid(serializedTopologyIdUuid)
.build();
final var endPointId = new EndPointId(topologyId, deviceIdUuid, endpointIdUuid);
final var serializedEndPointId =
ContextOuterClass.EndPointId.newBuilder()
.setTopologyId(serializedTopologyId)
.setDeviceId(serializedDeviceId)
.setEndpointUuid(serializedEndPointIdUuid)
.build();
final var aclMatch = createAclMatch(1, 2, "127.0.0.1", "127.0.0.2", 5601, 5602, 5, 10);
final var serializedAclMatch =
Acl.AclMatch.newBuilder()
.setDscp(1)
.setProtocol(2)
.setSrcAddress("127.0.0.1")
.setDstAddress("127.0.0.2")
.setSrcPort(5601)
.setDstPort(5602)
.setStartMplsLabel(5)
.setEndMplsLabel(10)
.build();
final var aclAction = createAclAction(AclForwardActionEnum.ACCEPT, AclLogActionEnum.SYSLOG);
final var serializedAclAction =
Acl.AclAction.newBuilder()
.setForwardAction(Acl.AclForwardActionEnum.ACLFORWARDINGACTION_ACCEPT)
.setLogAction(Acl.AclLogActionEnum.ACLLOGACTION_SYSLOG)
.build();
final var aclEntry = createAclEntry(1, "aclEntryDescription", aclMatch, aclAction);
final var serializedAclEntry =
Acl.AclEntry.newBuilder()
.setSequenceId(1)
.setDescription("aclEntryDescription")
.setMatch(serializedAclMatch)
.setAction(serializedAclAction)
.build();
final var aclRuleSet =
new AclRuleSet(
"aclRuleName",
eu.teraflow.automation.acl.AclRuleTypeEnum.IPV4,
"AclRuleDescription",
"userId",
List.of(aclEntry));
final var serializedAclRuleSet =
Acl.AclRuleSet.newBuilder()
.setName("aclRuleName")
.setType(Acl.AclRuleTypeEnum.ACLRULETYPE_IPV4)
.setDescription("AclRuleDescription")
.setUserId("userId")
.addEntries(serializedAclEntry)
.build();
final var configRuleAcl = new ConfigRuleAcl(endPointId, aclRuleSet);
final var configRuleTypeAcl = new ConfigRuleTypeAcl(configRuleAcl);
final var expectedConfigRule = new ConfigRule(ConfigActionEnum.DELETE, configRuleTypeAcl);
final var serializedConfigRuleAcl =
ContextOuterClass.ConfigRule_ACL.newBuilder()
.setEndpointId(serializedEndPointId)
.setRuleSet(serializedAclRuleSet)
.build();
final var serializedConfigRule =
ContextOuterClass.ConfigRule.newBuilder()
.setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE)
.setAcl(serializedConfigRuleAcl)
.build();
final var configRule = serializer.deserialize(serializedConfigRule);
assertThat(configRule).usingRecursiveComparison().isEqualTo(expectedConfigRule);
}
@Test
void shouldThrowIllegalStateExceptionDuringDeserializationOfNonSpecifiedConfigRule() {
final var serializedConfigRule =
ContextOuterClass.ConfigRule.newBuilder()
.setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET)
.build();
assertThatExceptionOfType(IllegalStateException.class)
.isThrownBy(() -> serializer.deserialize(serializedConfigRule));
}
private static Stream<Arguments> provideKpiSampleType() {
return Stream.of(
Arguments.of(
KpiSampleType.PACKETS_TRANSMITTED,
KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_PACKETS_TRANSMITTED),
Arguments.of(
KpiSampleType.PACKETS_RECEIVED,
KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_PACKETS_RECEIVED),
Arguments.of(
KpiSampleType.BYTES_TRANSMITTED,
KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_TRANSMITTED),
Arguments.of(
KpiSampleType.BYTES_RECEIVED,
KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_BYTES_RECEIVED),
Arguments.of(KpiSampleType.UNKNOWN, KpiSampleTypes.KpiSampleType.KPISAMPLETYPE_UNKNOWN));
}
@ParameterizedTest
@MethodSource("provideKpiSampleType")
void shouldSerializeKpiSampleType(
KpiSampleType kpiSampleType, KpiSampleTypes.KpiSampleType expectedSerializedType) {
final var serializedKpiSampleType = serializer.serialize(kpiSampleType);
assertThat(serializedKpiSampleType.getNumber()).isEqualTo(expectedSerializedType.getNumber());
}
@ParameterizedTest
@MethodSource("provideKpiSampleType")
void shouldDeserializeKpiSampleType(
KpiSampleType expectedKpiSampleType, KpiSampleTypes.KpiSampleType serializedKpiSampleType) {
final var kpiSampleType = serializer.deserialize(serializedKpiSampleType);
assertThat(kpiSampleType).isEqualTo(expectedKpiSampleType);
}
private static Stream<Arguments> provideDeviceDriverEnum() {
return Stream.of(
Arguments.of(
DeviceDriverEnum.OPENCONFIG,
ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_OPENCONFIG),
Arguments.of(
DeviceDriverEnum.TRANSPORT_API,
ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_TRANSPORT_API),
Arguments.of(DeviceDriverEnum.P4, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_P4),
Arguments.of(
DeviceDriverEnum.IETF_NETWORK_TOPOLOGY,
ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_NETWORK_TOPOLOGY),
Arguments.of(
DeviceDriverEnum.ONF_TR_352,
ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_ONF_TR_352),
Arguments.of(DeviceDriverEnum.XR, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_XR),
Arguments.of(
DeviceDriverEnum.IETF_L2VPN,
ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_IETF_L2VPN),
Arguments.of(
DeviceDriverEnum.UNDEFINED, ContextOuterClass.DeviceDriverEnum.DEVICEDRIVER_UNDEFINED));
}
@ParameterizedTest
@MethodSource("provideDeviceDriverEnum")
void shouldSerializeDeviceDriverEnum(
DeviceDriverEnum deviceDriverEnum,
ContextOuterClass.DeviceDriverEnum expectedDeviceDriverEnum) {
final var serializedDeviceDriverEnum = serializer.serialize(deviceDriverEnum);
assertThat(serializedDeviceDriverEnum.getNumber())
.isEqualTo(expectedDeviceDriverEnum.getNumber());
}
@ParameterizedTest
@MethodSource("provideDeviceDriverEnum")
void shouldDeserializeDeviceDriverEnum(
DeviceDriverEnum expectedDeviceDriverEnum,
ContextOuterClass.DeviceDriverEnum serializedDeviceDriverEnum) {
final var deviceDriverEnum = serializer.deserialize(serializedDeviceDriverEnum);
assertThat(deviceDriverEnum).isEqualTo(expectedDeviceDriverEnum);
}
@Test
void shouldSerializeDeviceConfig() {
final var expectedConfigRuleCustomA =
ContextOuterClass.ConfigRule_Custom.newBuilder()
.setResourceKey("resourceKeyA")
.setResourceValue("resourceValueA")
.build();
final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
final var expectedConfigRuleCustomB =
ContextOuterClass.ConfigRule_Custom.newBuilder()
.setResourceKey("resourceKeyB")
.setResourceValue("resourceValueB")
.build();
final var configRuleCustomB = new ConfigRuleCustom("resourceKeyB", "resourceValueB");
final var expectedConfigRuleA =
ContextOuterClass.ConfigRule.newBuilder()
.setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET)
.setCustom(expectedConfigRuleCustomA)
.build();
final var expectedConfigRuleB =
ContextOuterClass.ConfigRule.newBuilder()
.setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE)
.setCustom(expectedConfigRuleCustomB)
.build();
final var expectedDeviceConfig =
ContextOuterClass.DeviceConfig.newBuilder()
.addAllConfigRules(List.of(expectedConfigRuleA, expectedConfigRuleB))
.build();
final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA);
final var configRuleTypeB = new ConfigRuleTypeCustom(configRuleCustomB);
final var configRuleA = new ConfigRule(ConfigActionEnum.SET, configRuleTypeA);
final var configRuleB = new ConfigRule(ConfigActionEnum.DELETE, configRuleTypeB);
final var deviceConfig = new DeviceConfig(List.of(configRuleA, configRuleB));
final var serializedDeviceConfig = serializer.serialize(deviceConfig);
assertThat(serializedDeviceConfig).isEqualTo(expectedDeviceConfig);
}
@Test
void shouldDeserializeDeviceConfig() {
final var expectedConfigRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
final var expectedConfigRuleCustomB = new ConfigRuleCustom("resourceKeyB", "resourceValueB");
final var expectedConfigRuleTypeA = new ConfigRuleTypeCustom(expectedConfigRuleCustomA);
final var expectedConfigRuleTypeB = new ConfigRuleTypeCustom(expectedConfigRuleCustomB);
final var expectedConfigRuleA = new ConfigRule(ConfigActionEnum.SET, expectedConfigRuleTypeA);
final var expectedConfigRuleB =
new ConfigRule(ConfigActionEnum.DELETE, expectedConfigRuleTypeB);
final var expectedDeviceConfig =
new DeviceConfig(List.of(expectedConfigRuleA, expectedConfigRuleB));
final var configRuleCustomA =
ContextOuterClass.ConfigRule_Custom.newBuilder()
.setResourceKey("resourceKeyA")
.setResourceValue("resourceValueA")
.build();
final var configRuleCustomB =
ContextOuterClass.ConfigRule_Custom.newBuilder()
.setResourceKey("resourceKeyB")
.setResourceValue("resourceValueB")
.build();
final var configRuleA =
ContextOuterClass.ConfigRule.newBuilder()
.setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET)
.setCustom(configRuleCustomA)
.build();
final var configRuleB =
ContextOuterClass.ConfigRule.newBuilder()
.setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE)
.setCustom(configRuleCustomB)
.build();
final var serializedDeviceConfig =
ContextOuterClass.DeviceConfig.newBuilder()
.addAllConfigRules(List.of(configRuleA, configRuleB))
.build();
final var deviceConfig = serializer.deserialize(serializedDeviceConfig);
assertThat(deviceConfig).usingRecursiveComparison().isEqualTo(expectedDeviceConfig);
}
private static Stream<Arguments> provideOperationalStatusEnum() {
return Stream.of(
Arguments.of(
DeviceOperationalStatus.ENABLED,
DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_ENABLED),
Arguments.of(
DeviceOperationalStatus.DISABLED,
DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_DISABLED),
Arguments.of(
DeviceOperationalStatus.UNDEFINED,
DeviceOperationalStatusEnum.DEVICEOPERATIONALSTATUS_UNDEFINED));
}
@ParameterizedTest
@MethodSource("provideOperationalStatusEnum")
void shouldSerializeOperationalStatusEnum(
DeviceOperationalStatus opStatus,
ContextOuterClass.DeviceOperationalStatusEnum expectedOpStatus) {
final var serializedOpStatus = serializer.serialize(opStatus);
assertThat(serializedOpStatus.getNumber()).isEqualTo(expectedOpStatus.getNumber());
}
@ParameterizedTest
@MethodSource("provideOperationalStatusEnum")
void shouldDeserializeOperationalStatusEnum(
DeviceOperationalStatus expectedOpStatus,
ContextOuterClass.DeviceOperationalStatusEnum serializedOpStatus) {
final var operationalStatus = serializer.deserialize(serializedOpStatus);
assertThat(operationalStatus).isEqualTo(expectedOpStatus);
}
@Test
void shouldSerializeLocationOfTypeRegion() {
final var region = "Tokyo";
final var locationTypeRegion = new LocationTypeRegion(region);
final var location = new Location(locationTypeRegion);
final var expectedLocation = ContextOuterClass.Location.newBuilder().setRegion(region).build();
final var serializedLocation = serializer.serialize(location);
assertThat(serializedLocation).isEqualTo(expectedLocation);
}
@Test
void shouldDeserializeLocationOfTypeRegion() {
final var region = "Tokyo";
final var locationTypeRegion = new LocationTypeRegion(region);
final var expectedLocation = new Location(locationTypeRegion);
final var serializedLocation =
ContextOuterClass.Location.newBuilder().setRegion(region).build();
final var location = serializer.deserialize(serializedLocation);
assertThat(location).usingRecursiveComparison().isEqualTo(expectedLocation);
}
@Test
void shouldSerializeLocationOfTypeGpsPosition() {
final var latitude = 33.3f;
final var longitude = 86.4f;
final var gpsPosition = new GpsPosition(latitude, longitude);
final var locationTypeGpsPosition = new LocationTypeGpsPosition(gpsPosition);
final var location = new Location(locationTypeGpsPosition);
final var serializedGpsPosition =
ContextOuterClass.GPS_Position.newBuilder()
.setLatitude(latitude)
.setLongitude(longitude)
.build();
final var expectedLocation =
ContextOuterClass.Location.newBuilder().setGpsPosition(serializedGpsPosition).build();
final var serializedLocation = serializer.serialize(location);
assertThat(serializedLocation).isEqualTo(expectedLocation);
}
@Test
void shouldDeserializeLocationOfTypeGpsPosition() {
final var latitude = 33.3f;
final var longitude = 86.4f;
final var gpsPosition = new GpsPosition(latitude, longitude);
final var locationTypeGpsPosition = new LocationTypeGpsPosition(gpsPosition);
final var expectedLocation = new Location(locationTypeGpsPosition);
final var serializedGpsPosition =
ContextOuterClass.GPS_Position.newBuilder()
.setLatitude(latitude)
.setLongitude(longitude)
.build();
final var serializedLocation =
ContextOuterClass.Location.newBuilder().setGpsPosition(serializedGpsPosition).build();
final var location = serializer.deserialize(serializedLocation);
assertThat(location).usingRecursiveComparison().isEqualTo(expectedLocation);
}
@Test
void shouldThrowIllegalStateExceptionDuringDeserializationOfNonSpecifiedLocation() {
final var serializedLocation = ContextOuterClass.Location.newBuilder().build();
assertThatExceptionOfType(IllegalStateException.class)
.isThrownBy(() -> serializer.deserialize(serializedLocation));
}
@Test
void shouldSerializeEndPointWithAllAvailableFields() {
final var expectedTopologyId = new TopologyId("contextId", "id");
final var expectedDeviceId = "expectedDeviceId";
final var expectedId = "expectedId";
final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
final var endPointType = "endPointType";
final var kpiSampleTypes =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegion = new LocationTypeRegion("ATH");
final var location = new Location(locationTypeRegion);
final var endPoint =
new EndPointBuilder(endPointId, endPointType, kpiSampleTypes).location(location).build();
final var serializedEndPointId = serializer.serialize(endPointId);
final var serializedKpiSampleTypes =
kpiSampleTypes.stream().map(serializer::serialize).collect(Collectors.toList());
final var serializedEndPointLocation = serializer.serialize(location);
final var expectedEndPoint =
ContextOuterClass.EndPoint.newBuilder()
.setEndpointId(serializedEndPointId)
.setEndpointType(endPointType)
.addAllKpiSampleTypes(serializedKpiSampleTypes)
.setEndpointLocation(serializedEndPointLocation)
.build();
final var serializedEndPoint = serializer.serialize(endPoint);
assertThat(serializedEndPoint).isEqualTo(expectedEndPoint);
}
@Test
void shouldDeserializeEndPointWithAllAvailableFields() {
final var expectedTopologyId = new TopologyId("contextId", "id");
final var expectedDeviceId = "expectedDeviceId";
final var expectedId = "expectedId";
final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
final var endPointType = "endPointType";
final var kpiSampleTypes =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegion = new LocationTypeRegion("ATH");
final var location = new Location(locationTypeRegion);
final var expectedEndPoint =
new EndPointBuilder(endPointId, endPointType, kpiSampleTypes).location(location).build();
final var serializedEndPointId = serializer.serialize(endPointId);
final var serializedKpiSampleTypes =
kpiSampleTypes.stream().map(serializer::serialize).collect(Collectors.toList());
final var serializedEndPointLocation = serializer.serialize(location);
final var serializedEndPoint =
ContextOuterClass.EndPoint.newBuilder()
.setEndpointId(serializedEndPointId)
.setEndpointType(endPointType)
.addAllKpiSampleTypes(serializedKpiSampleTypes)
.setEndpointLocation(serializedEndPointLocation)
.build();
final var endPoint = serializer.deserialize(serializedEndPoint);
assertThat(endPoint).usingRecursiveComparison().isEqualTo(expectedEndPoint);
}
@Test
void shouldSerializeEndPointWithAllAvailableFieldsMissingLocation() {
final var expectedTopologyId = new TopologyId("contextId", "id");
final var expectedDeviceId = "expectedDeviceId";
final var expectedId = "expectedId";
final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
final var endPointType = "endPointType";
final var kpiSampleTypes =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var endPoint = new EndPointBuilder(endPointId, endPointType, kpiSampleTypes).build();
final var serializedEndPointId = serializer.serialize(endPointId);
final var serializedKpiSampleTypes =
kpiSampleTypes.stream().map(serializer::serialize).collect(Collectors.toList());
final var expectedEndPoint =
ContextOuterClass.EndPoint.newBuilder()
.setEndpointId(serializedEndPointId)
.setEndpointType(endPointType)
.addAllKpiSampleTypes(serializedKpiSampleTypes)
.build();
final var serializedEndPoint = serializer.serialize(endPoint);
assertThat(serializedEndPoint).isEqualTo(expectedEndPoint);
}
@Test
void shouldDeserializeEndPointWithAllAvailableFieldsMissingLocation() {
final var expectedTopologyId = new TopologyId("contextId", "id");
final var expectedDeviceId = "expectedDeviceId";
final var expectedId = "expectedId";
final var endPointId = new EndPointId(expectedTopologyId, expectedDeviceId, expectedId);
final var endPointType = "endPointType";
final var kpiSampleTypes =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var expectedEndPoint =
new EndPointBuilder(endPointId, endPointType, kpiSampleTypes).build();
final var serializedEndPointId = serializer.serialize(endPointId);
final var serializedKpiSampleTypes =
kpiSampleTypes.stream().map(serializer::serialize).collect(Collectors.toList());
final var serializedEndPoint =
ContextOuterClass.EndPoint.newBuilder()
.setEndpointId(serializedEndPointId)
.setEndpointType(endPointType)
.addAllKpiSampleTypes(serializedKpiSampleTypes)
.build();
final var endPoint = serializer.deserialize(serializedEndPoint);
assertThat(endPoint).usingRecursiveComparison().isEqualTo(expectedEndPoint);
}
@Test
void shouldSerializeDevice() {
final var expectedConfigRuleCustomA =
ContextOuterClass.ConfigRule_Custom.newBuilder()
.setResourceKey("resourceKeyA")
.setResourceValue("resourceValueA")
.build();
final var configRuleCustomA = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
final var expectedConfigRule =
ContextOuterClass.ConfigRule.newBuilder()
.setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_SET)
.setCustom(expectedConfigRuleCustomA)
.build();
final var configRuleTypeA = new ConfigRuleTypeCustom(configRuleCustomA);
final var deviceConfig =
new DeviceConfig(List.of(new ConfigRule(ConfigActionEnum.SET, configRuleTypeA)));
final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4);
final var expectedTopologyIdA = new TopologyId("contextIdA", "idA");
final var expectedDeviceIdA = "expectedDeviceIdA";
final var expectedIdA = "expectedIdA";
final var endPointIdA = new EndPointId(expectedTopologyIdA, expectedDeviceIdA, expectedIdA);
final var endPointTypeA = "endPointTypeA";
final var kpiSampleTypesA =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegionA = new LocationTypeRegion("ATH");
final var locationA = new Location(locationTypeRegionA);
final var endPointA =
new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA)
.location(locationA)
.build();
final var expectedTopologyIdB = new TopologyId("contextIdB", "idB");
final var expectedDeviceIdB = "expectedDeviceIdB";
final var expectedIdB = "expectedIdB";
final var endPointIdB = new EndPointId(expectedTopologyIdB, expectedDeviceIdB, expectedIdB);
final var endPointTypeB = "endPointTypeB";
final var kpiSampleTypesB =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegionB = new LocationTypeRegion("ATH");
final var locationB = new Location(locationTypeRegionB);
final var endPointB =
new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB)
.location(locationB)
.build();
final var endPoints = List.of(endPointA, endPointB);
final var expectedDeviceConfig =
ContextOuterClass.DeviceConfig.newBuilder().addConfigRules(expectedConfigRule).build();
final var serializedDeviceId = serializer.serializeDeviceId("deviceId");
final var serializedDrivers =
deviceDrivers.stream()
.map(deviceDriverEnum -> serializer.serialize(deviceDriverEnum))
.collect(Collectors.toList());
final var serializedEndPoints =
endPoints.stream()
.map(endPoint -> serializer.serialize(endPoint))
.collect(Collectors.toList());
final var deviceBuilder = ContextOuterClass.Device.newBuilder();
deviceBuilder.setDeviceId(serializedDeviceId);
deviceBuilder.setName("deviceName");
deviceBuilder.setDeviceType("deviceType");
deviceBuilder.setDeviceConfig(expectedDeviceConfig);
deviceBuilder.setDeviceOperationalStatus(serializer.serialize(DeviceOperationalStatus.ENABLED));
deviceBuilder.addAllDeviceDrivers(serializedDrivers);
deviceBuilder.addAllDeviceEndpoints(serializedEndPoints);
final var expectedDevice = deviceBuilder.build();
final var device =
new Device(
"deviceId",
"deviceName",
"deviceType",
deviceConfig,
DeviceOperationalStatus.ENABLED,
deviceDrivers,
endPoints);
final var serializedDevice = serializer.serialize(device);
assertThat(serializedDevice).isEqualTo(expectedDevice);
}
@Test
void shouldDeserializeDevice() {
final var configRuleCustom = new ConfigRuleCustom("resourceKeyA", "resourceValueA");
final var expectedConfigRuleCustom =
ContextOuterClass.ConfigRule_Custom.newBuilder()
.setResourceKey("resourceKeyA")
.setResourceValue("resourceValueA")
.build();
final var configRuleType = new ConfigRuleTypeCustom(configRuleCustom);
final var expectedConfig =
new DeviceConfig(List.of(new ConfigRule(ConfigActionEnum.DELETE, configRuleType)));
final var deviceDrivers = List.of(DeviceDriverEnum.IETF_NETWORK_TOPOLOGY, DeviceDriverEnum.P4);
final var expectedTopologyIdA = new TopologyId("contextIdA", "idA");
final var expectedDeviceIdA = "expectedDeviceIdA";
final var expectedIdA = "expectedIdA";
final var endPointIdA = new EndPointId(expectedTopologyIdA, expectedDeviceIdA, expectedIdA);
final var endPointTypeA = "endPointTypeA";
final var kpiSampleTypesA =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegionA = new LocationTypeRegion("ATH");
final var locationA = new Location(locationTypeRegionA);
final var endPointA =
new EndPointBuilder(endPointIdA, endPointTypeA, kpiSampleTypesA)
.location(locationA)
.build();
final var expectedTopologyIdB = new TopologyId("contextIdB", "idB");
final var expectedDeviceIdB = "expectedDeviceIdB";
final var expectedIdB = "expectedIdB";
final var endPointIdB = new EndPointId(expectedTopologyIdB, expectedDeviceIdB, expectedIdB);
final var endPointTypeB = "endPointTypeB";
final var kpiSampleTypesB =
List.of(KpiSampleType.BYTES_RECEIVED, KpiSampleType.BYTES_TRANSMITTED);
final var locationTypeRegionB = new LocationTypeRegion("ATH");
final var locationB = new Location(locationTypeRegionB);
final var endPointB =
new EndPointBuilder(endPointIdB, endPointTypeB, kpiSampleTypesB)
.location(locationB)
.build();
final var endPoints = List.of(endPointA, endPointB);
final var expectedDevice =
new Device(
"deviceId",
"deviceName",
"deviceType",
expectedConfig,
DeviceOperationalStatus.ENABLED,
deviceDrivers,
endPoints);
final var configRule =
ContextOuterClass.ConfigRule.newBuilder()
.setAction(ContextOuterClass.ConfigActionEnum.CONFIGACTION_DELETE)
.setCustom(expectedConfigRuleCustom)
.build();
final var deviceConfig =
ContextOuterClass.DeviceConfig.newBuilder().addConfigRules(configRule).build();
final var serializedDeviceId = serializer.serializeDeviceId("deviceId");
final var serializedDeviceOperationalStatus =
serializer.serialize(DeviceOperationalStatus.ENABLED);
final var serializedDrivers =
deviceDrivers.stream()
.map(deviceDriverEnum -> serializer.serialize(deviceDriverEnum))
.collect(Collectors.toList());
final var serializedEndPoints =
endPoints.stream()
.map(endPoint -> serializer.serialize(endPoint))
.collect(Collectors.toList());
final var deviceBuilder = ContextOuterClass.Device.newBuilder();
deviceBuilder.setDeviceId(serializedDeviceId);
deviceBuilder.setName("deviceName");
deviceBuilder.setDeviceType("deviceType");
deviceBuilder.setDeviceConfig(deviceConfig);
deviceBuilder.setDeviceOperationalStatus(serializedDeviceOperationalStatus);
deviceBuilder.addAllDeviceDrivers(serializedDrivers);
deviceBuilder.addAllDeviceEndpoints(serializedEndPoints);
final var serializedDevice = deviceBuilder.build();
final var device = serializer.deserialize(serializedDevice);
assertThat(device).usingRecursiveComparison().isEqualTo(expectedDevice);
}
@Test
void shouldSerializeEmpty() {
final var empty = new Empty();
final var expectedEmpty = ContextOuterClass.Empty.newBuilder().build();
final var serializeEmpty = serializer.serializeEmpty(empty);
assertThat(serializeEmpty).isEqualTo(expectedEmpty);
}
@Test
void shouldDeserializeEmpty() {
final var expectedEmpty = new Empty();
final var serializedEmpty = serializer.serializeEmpty(expectedEmpty);
final var empty = serializer.deserializeEmpty(serializedEmpty);
assertThat(empty).usingRecursiveComparison().isEqualTo(expectedEmpty);
}
@Test
void shouldSerializeUuid() {
final var expectedUuid = "uuid";
final var serializeUuid = serializer.serializeUuid("uuid");
assertThat(serializeUuid.getUuid()).isEqualTo(expectedUuid);
}
@Test
void shouldDeserializeUuid() {
final var expectedUuid = "uuid";
final var uuid = serializer.deserialize(Uuid.newBuilder().setUuid("uuid").build());
assertThat(uuid).isEqualTo(expectedUuid);
}
}
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: acl.proto
package acl;
public final class Acl {
private Acl() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
/**
* Protobuf enum {@code acl.AclRuleTypeEnum}
*/
public enum AclRuleTypeEnum
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>ACLRULETYPE_UNDEFINED = 0;</code>
*/
ACLRULETYPE_UNDEFINED(0),
/**
* <code>ACLRULETYPE_IPV4 = 1;</code>
*/
ACLRULETYPE_IPV4(1),
/**
* <code>ACLRULETYPE_IPV6 = 2;</code>
*/
ACLRULETYPE_IPV6(2),
/**
* <code>ACLRULETYPE_L2 = 3;</code>
*/
ACLRULETYPE_L2(3),
/**
* <code>ACLRULETYPE_MPLS = 4;</code>
*/
ACLRULETYPE_MPLS(4),
/**
* <code>ACLRULETYPE_MIXED = 5;</code>
*/
ACLRULETYPE_MIXED(5),
UNRECOGNIZED(-1),
;
/**
* <code>ACLRULETYPE_UNDEFINED = 0;</code>
*/
public static final int ACLRULETYPE_UNDEFINED_VALUE = 0;
/**
* <code>ACLRULETYPE_IPV4 = 1;</code>
*/
public static final int ACLRULETYPE_IPV4_VALUE = 1;
/**
* <code>ACLRULETYPE_IPV6 = 2;</code>
*/
public static final int ACLRULETYPE_IPV6_VALUE = 2;
/**
* <code>ACLRULETYPE_L2 = 3;</code>
*/
public static final int ACLRULETYPE_L2_VALUE = 3;
/**
* <code>ACLRULETYPE_MPLS = 4;</code>
*/
public static final int ACLRULETYPE_MPLS_VALUE = 4;
/**
* <code>ACLRULETYPE_MIXED = 5;</code>
*/
public static final int ACLRULETYPE_MIXED_VALUE = 5;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static AclRuleTypeEnum valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static AclRuleTypeEnum forNumber(int value) {
switch (value) {
case 0: return ACLRULETYPE_UNDEFINED;
case 1: return ACLRULETYPE_IPV4;
case 2: return ACLRULETYPE_IPV6;
case 3: return ACLRULETYPE_L2;
case 4: return ACLRULETYPE_MPLS;
case 5: return ACLRULETYPE_MIXED;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<AclRuleTypeEnum>
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
AclRuleTypeEnum> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<AclRuleTypeEnum>() {
public AclRuleTypeEnum findValueByNumber(int number) {
return AclRuleTypeEnum.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return acl.Acl.getDescriptor().getEnumTypes().get(0);
}
private static final AclRuleTypeEnum[] VALUES = values();
public static AclRuleTypeEnum valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private AclRuleTypeEnum(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:acl.AclRuleTypeEnum)
}
/**
* Protobuf enum {@code acl.AclForwardActionEnum}
*/
public enum AclForwardActionEnum
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>ACLFORWARDINGACTION_UNDEFINED = 0;</code>
*/
ACLFORWARDINGACTION_UNDEFINED(0),
/**
* <code>ACLFORWARDINGACTION_DROP = 1;</code>
*/
ACLFORWARDINGACTION_DROP(1),
/**
* <code>ACLFORWARDINGACTION_ACCEPT = 2;</code>
*/
ACLFORWARDINGACTION_ACCEPT(2),
/**
* <code>ACLFORWARDINGACTION_REJECT = 3;</code>
*/
ACLFORWARDINGACTION_REJECT(3),
UNRECOGNIZED(-1),
;
/**
* <code>ACLFORWARDINGACTION_UNDEFINED = 0;</code>
*/
public static final int ACLFORWARDINGACTION_UNDEFINED_VALUE = 0;
/**
* <code>ACLFORWARDINGACTION_DROP = 1;</code>
*/
public static final int ACLFORWARDINGACTION_DROP_VALUE = 1;
/**
* <code>ACLFORWARDINGACTION_ACCEPT = 2;</code>
*/
public static final int ACLFORWARDINGACTION_ACCEPT_VALUE = 2;
/**
* <code>ACLFORWARDINGACTION_REJECT = 3;</code>
*/
public static final int ACLFORWARDINGACTION_REJECT_VALUE = 3;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static AclForwardActionEnum valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static AclForwardActionEnum forNumber(int value) {
switch (value) {
case 0: return ACLFORWARDINGACTION_UNDEFINED;
case 1: return ACLFORWARDINGACTION_DROP;
case 2: return ACLFORWARDINGACTION_ACCEPT;
case 3: return ACLFORWARDINGACTION_REJECT;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<AclForwardActionEnum>
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
AclForwardActionEnum> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<AclForwardActionEnum>() {
public AclForwardActionEnum findValueByNumber(int number) {
return AclForwardActionEnum.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return acl.Acl.getDescriptor().getEnumTypes().get(1);
}
private static final AclForwardActionEnum[] VALUES = values();
public static AclForwardActionEnum valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private AclForwardActionEnum(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:acl.AclForwardActionEnum)
}
/**
* Protobuf enum {@code acl.AclLogActionEnum}
*/
public enum AclLogActionEnum
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>ACLLOGACTION_UNDEFINED = 0;</code>
*/
ACLLOGACTION_UNDEFINED(0),
/**
* <code>ACLLOGACTION_NOLOG = 1;</code>
*/
ACLLOGACTION_NOLOG(1),
/**
* <code>ACLLOGACTION_SYSLOG = 2;</code>
*/
ACLLOGACTION_SYSLOG(2),
UNRECOGNIZED(-1),
;
/**
* <code>ACLLOGACTION_UNDEFINED = 0;</code>
*/
public static final int ACLLOGACTION_UNDEFINED_VALUE = 0;
/**
* <code>ACLLOGACTION_NOLOG = 1;</code>
*/
public static final int ACLLOGACTION_NOLOG_VALUE = 1;
/**
* <code>ACLLOGACTION_SYSLOG = 2;</code>
*/
public static final int ACLLOGACTION_SYSLOG_VALUE = 2;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static AclLogActionEnum valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static AclLogActionEnum forNumber(int value) {
switch (value) {
case 0: return ACLLOGACTION_UNDEFINED;
case 1: return ACLLOGACTION_NOLOG;
case 2: return ACLLOGACTION_SYSLOG;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<AclLogActionEnum>
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
AclLogActionEnum> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<AclLogActionEnum>() {
public AclLogActionEnum findValueByNumber(int number) {
return AclLogActionEnum.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return acl.Acl.getDescriptor().getEnumTypes().get(2);
}
private static final AclLogActionEnum[] VALUES = values();
public static AclLogActionEnum valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private AclLogActionEnum(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:acl.AclLogActionEnum)
}
public interface AclMatchOrBuilder extends
// @@protoc_insertion_point(interface_extends:acl.AclMatch)
com.google.protobuf.MessageOrBuilder {
/**
* <code>uint32 dscp = 1;</code>
* @return The dscp.
*/
int getDscp();
/**
* <code>uint32 protocol = 2;</code>
* @return The protocol.
*/
int getProtocol();
/**
* <code>string src_address = 3;</code>
* @return The srcAddress.
*/
java.lang.String getSrcAddress();
/**
* <code>string src_address = 3;</code>
* @return The bytes for srcAddress.
*/
com.google.protobuf.ByteString
getSrcAddressBytes();
/**
* <code>string dst_address = 4;</code>
* @return The dstAddress.
*/
java.lang.String getDstAddress();
/**
* <code>string dst_address = 4;</code>
* @return The bytes for dstAddress.
*/
com.google.protobuf.ByteString
getDstAddressBytes();
/**
* <code>uint32 src_port = 5;</code>
* @return The srcPort.
*/
int getSrcPort();
/**
* <code>uint32 dst_port = 6;</code>
* @return The dstPort.
*/
int getDstPort();
/**
* <code>uint32 start_mpls_label = 7;</code>
* @return The startMplsLabel.
*/
int getStartMplsLabel();
/**
* <code>uint32 end_mpls_label = 8;</code>
* @return The endMplsLabel.
*/
int getEndMplsLabel();
}
/**
* Protobuf type {@code acl.AclMatch}
*/
public static final class AclMatch extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:acl.AclMatch)
AclMatchOrBuilder {
private static final long serialVersionUID = 0L;
// Use AclMatch.newBuilder() to construct.
private AclMatch(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private AclMatch() {
srcAddress_ = "";
dstAddress_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new AclMatch();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private AclMatch(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
dscp_ = input.readUInt32();
break;
}
case 16: {
protocol_ = input.readUInt32();
break;
}
case 26: {
java.lang.String s = input.readStringRequireUtf8();
srcAddress_ = s;
break;
}
case 34: {
java.lang.String s = input.readStringRequireUtf8();
dstAddress_ = s;
break;
}
case 40: {
srcPort_ = input.readUInt32();
break;
}
case 48: {
dstPort_ = input.readUInt32();
break;
}
case 56: {
startMplsLabel_ = input.readUInt32();
break;
}
case 64: {
endMplsLabel_ = input.readUInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return acl.Acl.internal_static_acl_AclMatch_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return acl.Acl.internal_static_acl_AclMatch_fieldAccessorTable
.ensureFieldAccessorsInitialized(
acl.Acl.AclMatch.class, acl.Acl.AclMatch.Builder.class);
}
public static final int DSCP_FIELD_NUMBER = 1;
private int dscp_;
/**
* <code>uint32 dscp = 1;</code>
* @return The dscp.
*/
@java.lang.Override
public int getDscp() {
return dscp_;
}
public static final int PROTOCOL_FIELD_NUMBER = 2;
private int protocol_;
/**
* <code>uint32 protocol = 2;</code>
* @return The protocol.
*/
@java.lang.Override
public int getProtocol() {
return protocol_;
}
public static final int SRC_ADDRESS_FIELD_NUMBER = 3;
private volatile java.lang.Object srcAddress_;
/**
* <code>string src_address = 3;</code>
* @return The srcAddress.
*/
@java.lang.Override
public java.lang.String getSrcAddress() {
java.lang.Object ref = srcAddress_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
srcAddress_ = s;
return s;
}
}
/**
* <code>string src_address = 3;</code>
* @return The bytes for srcAddress.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getSrcAddressBytes() {
java.lang.Object ref = srcAddress_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
srcAddress_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DST_ADDRESS_FIELD_NUMBER = 4;
private volatile java.lang.Object dstAddress_;
/**
* <code>string dst_address = 4;</code>
* @return The dstAddress.
*/
@java.lang.Override
public java.lang.String getDstAddress() {
java.lang.Object ref = dstAddress_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
dstAddress_ = s;
return s;
}
}
/**
* <code>string dst_address = 4;</code>
* @return The bytes for dstAddress.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getDstAddressBytes() {
java.lang.Object ref = dstAddress_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
dstAddress_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SRC_PORT_FIELD_NUMBER = 5;
private int srcPort_;
/**
* <code>uint32 src_port = 5;</code>
* @return The srcPort.
*/
@java.lang.Override
public int getSrcPort() {
return srcPort_;
}
public static final int DST_PORT_FIELD_NUMBER = 6;
private int dstPort_;
/**
* <code>uint32 dst_port = 6;</code>
* @return The dstPort.
*/
@java.lang.Override
public int getDstPort() {
return dstPort_;
}
public static final int START_MPLS_LABEL_FIELD_NUMBER = 7;
private int startMplsLabel_;
/**
* <code>uint32 start_mpls_label = 7;</code>
* @return The startMplsLabel.
*/
@java.lang.Override
public int getStartMplsLabel() {
return startMplsLabel_;
}
public static final int END_MPLS_LABEL_FIELD_NUMBER = 8;
private int endMplsLabel_;
/**
* <code>uint32 end_mpls_label = 8;</code>
* @return The endMplsLabel.
*/
@java.lang.Override
public int getEndMplsLabel() {
return endMplsLabel_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (dscp_ != 0) {
output.writeUInt32(1, dscp_);
}
if (protocol_ != 0) {
output.writeUInt32(2, protocol_);
}
if (!getSrcAddressBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, srcAddress_);
}
if (!getDstAddressBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, dstAddress_);
}
if (srcPort_ != 0) {
output.writeUInt32(5, srcPort_);
}
if (dstPort_ != 0) {
output.writeUInt32(6, dstPort_);
}
if (startMplsLabel_ != 0) {
output.writeUInt32(7, startMplsLabel_);
}
if (endMplsLabel_ != 0) {
output.writeUInt32(8, endMplsLabel_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (dscp_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(1, dscp_);
}
if (protocol_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(2, protocol_);
}
if (!getSrcAddressBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, srcAddress_);
}
if (!getDstAddressBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, dstAddress_);
}
if (srcPort_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(5, srcPort_);
}
if (dstPort_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(6, dstPort_);
}
if (startMplsLabel_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(7, startMplsLabel_);
}
if (endMplsLabel_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(8, endMplsLabel_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof acl.Acl.AclMatch)) {
return super.equals(obj);
}
acl.Acl.AclMatch other = (acl.Acl.AclMatch) obj;
if (getDscp()
!= other.getDscp()) return false;
if (getProtocol()
!= other.getProtocol()) return false;
if (!getSrcAddress()
.equals(other.getSrcAddress())) return false;
if (!getDstAddress()
.equals(other.getDstAddress())) return false;
if (getSrcPort()
!= other.getSrcPort()) return false;
if (getDstPort()
!= other.getDstPort()) return false;
if (getStartMplsLabel()
!= other.getStartMplsLabel()) return false;
if (getEndMplsLabel()
!= other.getEndMplsLabel()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + DSCP_FIELD_NUMBER;
hash = (53 * hash) + getDscp();
hash = (37 * hash) + PROTOCOL_FIELD_NUMBER;
hash = (53 * hash) + getProtocol();
hash = (37 * hash) + SRC_ADDRESS_FIELD_NUMBER;
hash = (53 * hash) + getSrcAddress().hashCode();
hash = (37 * hash) + DST_ADDRESS_FIELD_NUMBER;
hash = (53 * hash) + getDstAddress().hashCode();
hash = (37 * hash) + SRC_PORT_FIELD_NUMBER;
hash = (53 * hash) + getSrcPort();
hash = (37 * hash) + DST_PORT_FIELD_NUMBER;
hash = (53 * hash) + getDstPort();
hash = (37 * hash) + START_MPLS_LABEL_FIELD_NUMBER;
hash = (53 * hash) + getStartMplsLabel();
hash = (37 * hash) + END_MPLS_LABEL_FIELD_NUMBER;
hash = (53 * hash) + getEndMplsLabel();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static acl.Acl.AclMatch parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static acl.Acl.AclMatch parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static acl.Acl.AclMatch parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static acl.Acl.AclMatch parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static acl.Acl.AclMatch parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static acl.Acl.AclMatch parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static acl.Acl.AclMatch parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static acl.Acl.AclMatch parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static acl.Acl.AclMatch parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static acl.Acl.AclMatch parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static acl.Acl.AclMatch parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static acl.Acl.AclMatch parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(acl.Acl.AclMatch prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code acl.AclMatch}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:acl.AclMatch)
acl.Acl.AclMatchOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return acl.Acl.internal_static_acl_AclMatch_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return acl.Acl.internal_static_acl_AclMatch_fieldAccessorTable
.ensureFieldAccessorsInitialized(
acl.Acl.AclMatch.class, acl.Acl.AclMatch.Builder.class);
}
// Construct using acl.Acl.AclMatch.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
dscp_ = 0;
protocol_ = 0;
srcAddress_ = "";
dstAddress_ = "";
srcPort_ = 0;
dstPort_ = 0;
startMplsLabel_ = 0;
endMplsLabel_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return acl.Acl.internal_static_acl_AclMatch_descriptor;
}
@java.lang.Override
public acl.Acl.AclMatch getDefaultInstanceForType() {
return acl.Acl.AclMatch.getDefaultInstance();
}
@java.lang.Override
public acl.Acl.AclMatch build() {
acl.Acl.AclMatch result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public acl.Acl.AclMatch buildPartial() {
acl.Acl.AclMatch result = new acl.Acl.AclMatch(this);
result.dscp_ = dscp_;
result.protocol_ = protocol_;
result.srcAddress_ = srcAddress_;
result.dstAddress_ = dstAddress_;
result.srcPort_ = srcPort_;
result.dstPort_ = dstPort_;
result.startMplsLabel_ = startMplsLabel_;
result.endMplsLabel_ = endMplsLabel_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof acl.Acl.AclMatch) {
return mergeFrom((acl.Acl.AclMatch)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(acl.Acl.AclMatch other) {
if (other == acl.Acl.AclMatch.getDefaultInstance()) return this;
if (other.getDscp() != 0) {
setDscp(other.getDscp());
}
if (other.getProtocol() != 0) {
setProtocol(other.getProtocol());
}
if (!other.getSrcAddress().isEmpty()) {
srcAddress_ = other.srcAddress_;
onChanged();
}
if (!other.getDstAddress().isEmpty()) {
dstAddress_ = other.dstAddress_;
onChanged();
}
if (other.getSrcPort() != 0) {
setSrcPort(other.getSrcPort());
}
if (other.getDstPort() != 0) {
setDstPort(other.getDstPort());
}
if (other.getStartMplsLabel() != 0) {
setStartMplsLabel(other.getStartMplsLabel());
}
if (other.getEndMplsLabel() != 0) {
setEndMplsLabel(other.getEndMplsLabel());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
acl.Acl.AclMatch parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (acl.Acl.AclMatch) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int dscp_ ;
/**
* <code>uint32 dscp = 1;</code>
* @return The dscp.
*/
@java.lang.Override
public int getDscp() {
return dscp_;
}
/**
* <code>uint32 dscp = 1;</code>
* @param value The dscp to set.
* @return This builder for chaining.
*/
public Builder setDscp(int value) {
dscp_ = value;
onChanged();
return this;
}
/**
* <code>uint32 dscp = 1;</code>
* @return This builder for chaining.
*/
public Builder clearDscp() {
dscp_ = 0;
onChanged();
return this;
}
private int protocol_ ;
/**
* <code>uint32 protocol = 2;</code>
* @return The protocol.
*/
@java.lang.Override
public int getProtocol() {
return protocol_;
}
/**
* <code>uint32 protocol = 2;</code>
* @param value The protocol to set.
* @return This builder for chaining.
*/
public Builder setProtocol(int value) {
protocol_ = value;
onChanged();
return this;
}
/**
* <code>uint32 protocol = 2;</code>
* @return This builder for chaining.
*/
public Builder clearProtocol() {
protocol_ = 0;
onChanged();
return this;
}
private java.lang.Object srcAddress_ = "";
/**
* <code>string src_address = 3;</code>
* @return The srcAddress.
*/
public java.lang.String getSrcAddress() {
java.lang.Object ref = srcAddress_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
srcAddress_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string src_address = 3;</code>
* @return The bytes for srcAddress.
*/
public com.google.protobuf.ByteString
getSrcAddressBytes() {
java.lang.Object ref = srcAddress_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
srcAddress_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string src_address = 3;</code>
* @param value The srcAddress to set.
* @return This builder for chaining.
*/
public Builder setSrcAddress(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
srcAddress_ = value;
onChanged();
return this;
}
/**
* <code>string src_address = 3;</code>
* @return This builder for chaining.
*/
public Builder clearSrcAddress() {
srcAddress_ = getDefaultInstance().getSrcAddress();
onChanged();
return this;
}
/**
* <code>string src_address = 3;</code>
* @param value The bytes for srcAddress to set.
* @return This builder for chaining.
*/
public Builder setSrcAddressBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
srcAddress_ = value;
onChanged();
return this;
}
private java.lang.Object dstAddress_ = "";
/**
* <code>string dst_address = 4;</code>
* @return The dstAddress.
*/
public java.lang.String getDstAddress() {
java.lang.Object ref = dstAddress_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
dstAddress_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string dst_address = 4;</code>
* @return The bytes for dstAddress.
*/
public com.google.protobuf.ByteString
getDstAddressBytes() {
java.lang.Object ref = dstAddress_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
dstAddress_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string dst_address = 4;</code>
* @param value The dstAddress to set.
* @return This builder for chaining.
*/
public Builder setDstAddress(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
dstAddress_ = value;
onChanged();
return this;
}
/**
* <code>string dst_address = 4;</code>
* @return This builder for chaining.
*/
public Builder clearDstAddress() {
dstAddress_ = getDefaultInstance().getDstAddress();
onChanged();
return this;
}
/**
* <code>string dst_address = 4;</code>
* @param value The bytes for dstAddress to set.
* @return This builder for chaining.
*/
public Builder setDstAddressBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
dstAddress_ = value;
onChanged();
return this;
}
private int srcPort_ ;
/**
* <code>uint32 src_port = 5;</code>
* @return The srcPort.
*/
@java.lang.Override
public int getSrcPort() {
return srcPort_;
}
/**
* <code>uint32 src_port = 5;</code>
* @param value The srcPort to set.
* @return This builder for chaining.
*/
public Builder setSrcPort(int value) {
srcPort_ = value;
onChanged();
return this;
}
/**
* <code>uint32 src_port = 5;</code>
* @return This builder for chaining.
*/
public Builder clearSrcPort() {
srcPort_ = 0;
onChanged();
return this;
}
private int dstPort_ ;
/**
* <code>uint32 dst_port = 6;</code>
* @return The dstPort.
*/
@java.lang.Override
public int getDstPort() {
return dstPort_;
}
/**
* <code>uint32 dst_port = 6;</code>
* @param value The dstPort to set.
* @return This builder for chaining.
*/
public Builder setDstPort(int value) {
dstPort_ = value;
onChanged();
return this;
}
/**
* <code>uint32 dst_port = 6;</code>
* @return This builder for chaining.
*/
public Builder clearDstPort() {
dstPort_ = 0;
onChanged();
return this;
}
private int startMplsLabel_ ;
/**
* <code>uint32 start_mpls_label = 7;</code>
* @return The startMplsLabel.
*/
@java.lang.Override
public int getStartMplsLabel() {
return startMplsLabel_;
}
/**
* <code>uint32 start_mpls_label = 7;</code>
* @param value The startMplsLabel to set.
* @return This builder for chaining.
*/
public Builder setStartMplsLabel(int value) {
startMplsLabel_ = value;
onChanged();
return this;
}
/**
* <code>uint32 start_mpls_label = 7;</code>
* @return This builder for chaining.
*/
public Builder clearStartMplsLabel() {
startMplsLabel_ = 0;
onChanged();
return this;
}
private int endMplsLabel_ ;
/**
* <code>uint32 end_mpls_label = 8;</code>
* @return The endMplsLabel.
*/
@java.lang.Override
public int getEndMplsLabel() {
return endMplsLabel_;
}
/**
* <code>uint32 end_mpls_label = 8;</code>
* @param value The endMplsLabel to set.
* @return This builder for chaining.
*/
public Builder setEndMplsLabel(int value) {
endMplsLabel_ = value;
onChanged();
return this;
}
/**
* <code>uint32 end_mpls_label = 8;</code>
* @return This builder for chaining.
*/
public Builder clearEndMplsLabel() {
endMplsLabel_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:acl.AclMatch)
}
// @@protoc_insertion_point(class_scope:acl.AclMatch)
private static final acl.Acl.AclMatch DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new acl.Acl.AclMatch();
}
public static acl.Acl.AclMatch getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<AclMatch>
PARSER = new com.google.protobuf.AbstractParser<AclMatch>() {
@java.lang.Override
public AclMatch parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new AclMatch(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<AclMatch> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<AclMatch> getParserForType() {
return PARSER;
}
@java.lang.Override
public acl.Acl.AclMatch getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface AclActionOrBuilder extends
// @@protoc_insertion_point(interface_extends:acl.AclAction)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.acl.AclForwardActionEnum forward_action = 1;</code>
* @return The enum numeric value on the wire for forwardAction.
*/
int getForwardActionValue();
/**
* <code>.acl.AclForwardActionEnum forward_action = 1;</code>
* @return The forwardAction.
*/
acl.Acl.AclForwardActionEnum getForwardAction();
/**
* <code>.acl.AclLogActionEnum log_action = 2;</code>
* @return The enum numeric value on the wire for logAction.
*/
int getLogActionValue();
/**
* <code>.acl.AclLogActionEnum log_action = 2;</code>
* @return The logAction.
*/
acl.Acl.AclLogActionEnum getLogAction();
}
/**
* Protobuf type {@code acl.AclAction}
*/
public static final class AclAction extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:acl.AclAction)
AclActionOrBuilder {
private static final long serialVersionUID = 0L;
// Use AclAction.newBuilder() to construct.
private AclAction(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private AclAction() {
forwardAction_ = 0;
logAction_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new AclAction();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private AclAction(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
int rawValue = input.readEnum();
forwardAction_ = rawValue;
break;
}
case 16: {
int rawValue = input.readEnum();
logAction_ = rawValue;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return acl.Acl.internal_static_acl_AclAction_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return acl.Acl.internal_static_acl_AclAction_fieldAccessorTable
.ensureFieldAccessorsInitialized(
acl.Acl.AclAction.class, acl.Acl.AclAction.Builder.class);
}
public static final int FORWARD_ACTION_FIELD_NUMBER = 1;
private int forwardAction_;
/**
* <code>.acl.AclForwardActionEnum forward_action = 1;</code>
* @return The enum numeric value on the wire for forwardAction.
*/
@java.lang.Override public int getForwardActionValue() {
return forwardAction_;
}
/**
* <code>.acl.AclForwardActionEnum forward_action = 1;</code>
* @return The forwardAction.
*/
@java.lang.Override public acl.Acl.AclForwardActionEnum getForwardAction() {
@SuppressWarnings("deprecation")
acl.Acl.AclForwardActionEnum result = acl.Acl.AclForwardActionEnum.valueOf(forwardAction_);
return result == null ? acl.Acl.AclForwardActionEnum.UNRECOGNIZED : result;
}
public static final int LOG_ACTION_FIELD_NUMBER = 2;
private int logAction_;
/**
* <code>.acl.AclLogActionEnum log_action = 2;</code>
* @return The enum numeric value on the wire for logAction.
*/
@java.lang.Override public int getLogActionValue() {
return logAction_;
}
/**
* <code>.acl.AclLogActionEnum log_action = 2;</code>
* @return The logAction.
*/
@java.lang.Override public acl.Acl.AclLogActionEnum getLogAction() {
@SuppressWarnings("deprecation")
acl.Acl.AclLogActionEnum result = acl.Acl.AclLogActionEnum.valueOf(logAction_);
return result == null ? acl.Acl.AclLogActionEnum.UNRECOGNIZED : result;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (forwardAction_ != acl.Acl.AclForwardActionEnum.ACLFORWARDINGACTION_UNDEFINED.getNumber()) {
output.writeEnum(1, forwardAction_);
}
if (logAction_ != acl.Acl.AclLogActionEnum.ACLLOGACTION_UNDEFINED.getNumber()) {
output.writeEnum(2, logAction_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (forwardAction_ != acl.Acl.AclForwardActionEnum.ACLFORWARDINGACTION_UNDEFINED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, forwardAction_);
}
if (logAction_ != acl.Acl.AclLogActionEnum.ACLLOGACTION_UNDEFINED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, logAction_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof acl.Acl.AclAction)) {
return super.equals(obj);
}
acl.Acl.AclAction other = (acl.Acl.AclAction) obj;
if (forwardAction_ != other.forwardAction_) return false;
if (logAction_ != other.logAction_) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + FORWARD_ACTION_FIELD_NUMBER;
hash = (53 * hash) + forwardAction_;
hash = (37 * hash) + LOG_ACTION_FIELD_NUMBER;
hash = (53 * hash) + logAction_;
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static acl.Acl.AclAction parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static acl.Acl.AclAction parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static acl.Acl.AclAction parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static acl.Acl.AclAction parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static acl.Acl.AclAction parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static acl.Acl.AclAction parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static acl.Acl.AclAction parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static acl.Acl.AclAction parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static acl.Acl.AclAction parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static acl.Acl.AclAction parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static acl.Acl.AclAction parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static acl.Acl.AclAction parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(acl.Acl.AclAction prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code acl.AclAction}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:acl.AclAction)
acl.Acl.AclActionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return acl.Acl.internal_static_acl_AclAction_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return acl.Acl.internal_static_acl_AclAction_fieldAccessorTable
.ensureFieldAccessorsInitialized(
acl.Acl.AclAction.class, acl.Acl.AclAction.Builder.class);
}
// Construct using acl.Acl.AclAction.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
forwardAction_ = 0;
logAction_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return acl.Acl.internal_static_acl_AclAction_descriptor;
}
@java.lang.Override
public acl.Acl.AclAction getDefaultInstanceForType() {
return acl.Acl.AclAction.getDefaultInstance();
}
@java.lang.Override
public acl.Acl.AclAction build() {
acl.Acl.AclAction result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public acl.Acl.AclAction buildPartial() {
acl.Acl.AclAction result = new acl.Acl.AclAction(this);
result.forwardAction_ = forwardAction_;
result.logAction_ = logAction_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof acl.Acl.AclAction) {
return mergeFrom((acl.Acl.AclAction)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(acl.Acl.AclAction other) {
if (other == acl.Acl.AclAction.getDefaultInstance()) return this;
if (other.forwardAction_ != 0) {
setForwardActionValue(other.getForwardActionValue());
}
if (other.logAction_ != 0) {
setLogActionValue(other.getLogActionValue());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
acl.Acl.AclAction parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (acl.Acl.AclAction) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int forwardAction_ = 0;
/**
* <code>.acl.AclForwardActionEnum forward_action = 1;</code>
* @return The enum numeric value on the wire for forwardAction.
*/
@java.lang.Override public int getForwardActionValue() {
return forwardAction_;
}
/**
* <code>.acl.AclForwardActionEnum forward_action = 1;</code>
* @param value The enum numeric value on the wire for forwardAction to set.
* @return This builder for chaining.
*/
public Builder setForwardActionValue(int value) {
forwardAction_ = value;
onChanged();
return this;
}
/**
* <code>.acl.AclForwardActionEnum forward_action = 1;</code>
* @return The forwardAction.
*/
@java.lang.Override
public acl.Acl.AclForwardActionEnum getForwardAction() {
@SuppressWarnings("deprecation")
acl.Acl.AclForwardActionEnum result = acl.Acl.AclForwardActionEnum.valueOf(forwardAction_);
return result == null ? acl.Acl.AclForwardActionEnum.UNRECOGNIZED : result;
}
/**
* <code>.acl.AclForwardActionEnum forward_action = 1;</code>
* @param value The forwardAction to set.
* @return This builder for chaining.
*/
public Builder setForwardAction(acl.Acl.AclForwardActionEnum value) {
if (value == null) {
throw new NullPointerException();
}
forwardAction_ = value.getNumber();
onChanged();
return this;
}
/**
* <code>.acl.AclForwardActionEnum forward_action = 1;</code>
* @return This builder for chaining.
*/
public Builder clearForwardAction() {
forwardAction_ = 0;
onChanged();
return this;
}
private int logAction_ = 0;
/**
* <code>.acl.AclLogActionEnum log_action = 2;</code>
* @return The enum numeric value on the wire for logAction.
*/
@java.lang.Override public int getLogActionValue() {
return logAction_;
}
/**
* <code>.acl.AclLogActionEnum log_action = 2;</code>
* @param value The enum numeric value on the wire for logAction to set.
* @return This builder for chaining.
*/
public Builder setLogActionValue(int value) {
logAction_ = value;
onChanged();
return this;
}
/**
* <code>.acl.AclLogActionEnum log_action = 2;</code>
* @return The logAction.
*/
@java.lang.Override
public acl.Acl.AclLogActionEnum getLogAction() {
@SuppressWarnings("deprecation")
acl.Acl.AclLogActionEnum result = acl.Acl.AclLogActionEnum.valueOf(logAction_);
return result == null ? acl.Acl.AclLogActionEnum.UNRECOGNIZED : result;
}
/**
* <code>.acl.AclLogActionEnum log_action = 2;</code>
* @param value The logAction to set.
* @return This builder for chaining.
*/
public Builder setLogAction(acl.Acl.AclLogActionEnum value) {
if (value == null) {
throw new NullPointerException();
}
logAction_ = value.getNumber();
onChanged();
return this;
}
/**
* <code>.acl.AclLogActionEnum log_action = 2;</code>
* @return This builder for chaining.
*/
public Builder clearLogAction() {
logAction_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:acl.AclAction)
}
// @@protoc_insertion_point(class_scope:acl.AclAction)
private static final acl.Acl.AclAction DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new acl.Acl.AclAction();
}
public static acl.Acl.AclAction getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<AclAction>
PARSER = new com.google.protobuf.AbstractParser<AclAction>() {
@java.lang.Override
public AclAction parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new AclAction(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<AclAction> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<AclAction> getParserForType() {
return PARSER;
}
@java.lang.Override
public acl.Acl.AclAction getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface AclEntryOrBuilder extends
// @@protoc_insertion_point(interface_extends:acl.AclEntry)
com.google.protobuf.MessageOrBuilder {
/**
* <code>uint32 sequence_id = 1;</code>
* @return The sequenceId.
*/
int getSequenceId();
/**
* <code>string description = 2;</code>
* @return The description.
*/
java.lang.String getDescription();
/**
* <code>string description = 2;</code>
* @return The bytes for description.
*/
com.google.protobuf.ByteString
getDescriptionBytes();
/**
* <code>.acl.AclMatch match = 3;</code>
* @return Whether the match field is set.
*/
boolean hasMatch();
/**
* <code>.acl.AclMatch match = 3;</code>
* @return The match.
*/
acl.Acl.AclMatch getMatch();
/**
* <code>.acl.AclMatch match = 3;</code>
*/
acl.Acl.AclMatchOrBuilder getMatchOrBuilder();
/**
* <code>.acl.AclAction action = 4;</code>
* @return Whether the action field is set.
*/
boolean hasAction();
/**
* <code>.acl.AclAction action = 4;</code>
* @return The action.
*/
acl.Acl.AclAction getAction();
/**
* <code>.acl.AclAction action = 4;</code>
*/
acl.Acl.AclActionOrBuilder getActionOrBuilder();
}
/**
* Protobuf type {@code acl.AclEntry}
*/
public static final class AclEntry extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:acl.AclEntry)
AclEntryOrBuilder {
private static final long serialVersionUID = 0L;
// Use AclEntry.newBuilder() to construct.
private AclEntry(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private AclEntry() {
description_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new AclEntry();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private AclEntry(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
sequenceId_ = input.readUInt32();
break;
}
case 18: {
java.lang.String s = input.readStringRequireUtf8();
description_ = s;
break;
}
case 26: {
acl.Acl.AclMatch.Builder subBuilder = null;
if (match_ != null) {
subBuilder = match_.toBuilder();
}
match_ = input.readMessage(acl.Acl.AclMatch.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(match_);
match_ = subBuilder.buildPartial();
}
break;
}
case 34: {
acl.Acl.AclAction.Builder subBuilder = null;
if (action_ != null) {
subBuilder = action_.toBuilder();
}
action_ = input.readMessage(acl.Acl.AclAction.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(action_);
action_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return acl.Acl.internal_static_acl_AclEntry_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return acl.Acl.internal_static_acl_AclEntry_fieldAccessorTable
.ensureFieldAccessorsInitialized(
acl.Acl.AclEntry.class, acl.Acl.AclEntry.Builder.class);
}
public static final int SEQUENCE_ID_FIELD_NUMBER = 1;
private int sequenceId_;
/**
* <code>uint32 sequence_id = 1;</code>
* @return The sequenceId.
*/
@java.lang.Override
public int getSequenceId() {
return sequenceId_;
}
public static final int DESCRIPTION_FIELD_NUMBER = 2;
private volatile java.lang.Object description_;
/**
* <code>string description = 2;</code>
* @return The description.
*/
@java.lang.Override
public java.lang.String getDescription() {
java.lang.Object ref = description_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
description_ = s;
return s;
}
}
/**
* <code>string description = 2;</code>
* @return The bytes for description.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getDescriptionBytes() {
java.lang.Object ref = description_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
description_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int MATCH_FIELD_NUMBER = 3;
private acl.Acl.AclMatch match_;
/**
* <code>.acl.AclMatch match = 3;</code>
* @return Whether the match field is set.
*/
@java.lang.Override
public boolean hasMatch() {
return match_ != null;
}
/**
* <code>.acl.AclMatch match = 3;</code>
* @return The match.
*/
@java.lang.Override
public acl.Acl.AclMatch getMatch() {
return match_ == null ? acl.Acl.AclMatch.getDefaultInstance() : match_;
}
/**
* <code>.acl.AclMatch match = 3;</code>
*/
@java.lang.Override
public acl.Acl.AclMatchOrBuilder getMatchOrBuilder() {
return getMatch();
}
public static final int ACTION_FIELD_NUMBER = 4;
private acl.Acl.AclAction action_;
/**
* <code>.acl.AclAction action = 4;</code>
* @return Whether the action field is set.
*/
@java.lang.Override
public boolean hasAction() {
return action_ != null;
}
/**
* <code>.acl.AclAction action = 4;</code>
* @return The action.
*/
@java.lang.Override
public acl.Acl.AclAction getAction() {
return action_ == null ? acl.Acl.AclAction.getDefaultInstance() : action_;
}
/**
* <code>.acl.AclAction action = 4;</code>
*/
@java.lang.Override
public acl.Acl.AclActionOrBuilder getActionOrBuilder() {
return getAction();
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (sequenceId_ != 0) {
output.writeUInt32(1, sequenceId_);
}
if (!getDescriptionBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_);
}
if (match_ != null) {
output.writeMessage(3, getMatch());
}
if (action_ != null) {
output.writeMessage(4, getAction());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (sequenceId_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(1, sequenceId_);
}
if (!getDescriptionBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_);
}
if (match_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, getMatch());
}
if (action_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getAction());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof acl.Acl.AclEntry)) {
return super.equals(obj);
}
acl.Acl.AclEntry other = (acl.Acl.AclEntry) obj;
if (getSequenceId()
!= other.getSequenceId()) return false;
if (!getDescription()
.equals(other.getDescription())) return false;
if (hasMatch() != other.hasMatch()) return false;
if (hasMatch()) {
if (!getMatch()
.equals(other.getMatch())) return false;
}
if (hasAction() != other.hasAction()) return false;
if (hasAction()) {
if (!getAction()
.equals(other.getAction())) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + SEQUENCE_ID_FIELD_NUMBER;
hash = (53 * hash) + getSequenceId();
hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER;
hash = (53 * hash) + getDescription().hashCode();
if (hasMatch()) {
hash = (37 * hash) + MATCH_FIELD_NUMBER;
hash = (53 * hash) + getMatch().hashCode();
}
if (hasAction()) {
hash = (37 * hash) + ACTION_FIELD_NUMBER;
hash = (53 * hash) + getAction().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static acl.Acl.AclEntry parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static acl.Acl.AclEntry parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static acl.Acl.AclEntry parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static acl.Acl.AclEntry parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static acl.Acl.AclEntry parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static acl.Acl.AclEntry parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static acl.Acl.AclEntry parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static acl.Acl.AclEntry parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static acl.Acl.AclEntry parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static acl.Acl.AclEntry parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static acl.Acl.AclEntry parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static acl.Acl.AclEntry parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(acl.Acl.AclEntry prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code acl.AclEntry}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:acl.AclEntry)
acl.Acl.AclEntryOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return acl.Acl.internal_static_acl_AclEntry_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return acl.Acl.internal_static_acl_AclEntry_fieldAccessorTable
.ensureFieldAccessorsInitialized(
acl.Acl.AclEntry.class, acl.Acl.AclEntry.Builder.class);
}
// Construct using acl.Acl.AclEntry.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
sequenceId_ = 0;
description_ = "";
if (matchBuilder_ == null) {
match_ = null;
} else {
match_ = null;
matchBuilder_ = null;
}
if (actionBuilder_ == null) {
action_ = null;
} else {
action_ = null;
actionBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return acl.Acl.internal_static_acl_AclEntry_descriptor;
}
@java.lang.Override
public acl.Acl.AclEntry getDefaultInstanceForType() {
return acl.Acl.AclEntry.getDefaultInstance();
}
@java.lang.Override
public acl.Acl.AclEntry build() {
acl.Acl.AclEntry result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public acl.Acl.AclEntry buildPartial() {
acl.Acl.AclEntry result = new acl.Acl.AclEntry(this);
result.sequenceId_ = sequenceId_;
result.description_ = description_;
if (matchBuilder_ == null) {
result.match_ = match_;
} else {
result.match_ = matchBuilder_.build();
}
if (actionBuilder_ == null) {
result.action_ = action_;
} else {
result.action_ = actionBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof acl.Acl.AclEntry) {
return mergeFrom((acl.Acl.AclEntry)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(acl.Acl.AclEntry other) {
if (other == acl.Acl.AclEntry.getDefaultInstance()) return this;
if (other.getSequenceId() != 0) {
setSequenceId(other.getSequenceId());
}
if (!other.getDescription().isEmpty()) {
description_ = other.description_;
onChanged();
}
if (other.hasMatch()) {
mergeMatch(other.getMatch());
}
if (other.hasAction()) {
mergeAction(other.getAction());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
acl.Acl.AclEntry parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (acl.Acl.AclEntry) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int sequenceId_ ;
/**
* <code>uint32 sequence_id = 1;</code>
* @return The sequenceId.
*/
@java.lang.Override
public int getSequenceId() {
return sequenceId_;
}
/**
* <code>uint32 sequence_id = 1;</code>
* @param value The sequenceId to set.
* @return This builder for chaining.
*/
public Builder setSequenceId(int value) {
sequenceId_ = value;
onChanged();
return this;
}
/**
* <code>uint32 sequence_id = 1;</code>
* @return This builder for chaining.
*/
public Builder clearSequenceId() {
sequenceId_ = 0;
onChanged();
return this;
}
private java.lang.Object description_ = "";
/**
* <code>string description = 2;</code>
* @return The description.
*/
public java.lang.String getDescription() {
java.lang.Object ref = description_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
description_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string description = 2;</code>
* @return The bytes for description.
*/
public com.google.protobuf.ByteString
getDescriptionBytes() {
java.lang.Object ref = description_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
description_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string description = 2;</code>
* @param value The description to set.
* @return This builder for chaining.
*/
public Builder setDescription(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
description_ = value;
onChanged();
return this;
}
/**
* <code>string description = 2;</code>
* @return This builder for chaining.
*/
public Builder clearDescription() {
description_ = getDefaultInstance().getDescription();
onChanged();
return this;
}
/**
* <code>string description = 2;</code>
* @param value The bytes for description to set.
* @return This builder for chaining.
*/
public Builder setDescriptionBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
description_ = value;
onChanged();
return this;
}
private acl.Acl.AclMatch match_;
private com.google.protobuf.SingleFieldBuilderV3<
acl.Acl.AclMatch, acl.Acl.AclMatch.Builder, acl.Acl.AclMatchOrBuilder> matchBuilder_;
/**
* <code>.acl.AclMatch match = 3;</code>
* @return Whether the match field is set.
*/
public boolean hasMatch() {
return matchBuilder_ != null || match_ != null;
}
/**
* <code>.acl.AclMatch match = 3;</code>
* @return The match.
*/
public acl.Acl.AclMatch getMatch() {
if (matchBuilder_ == null) {
return match_ == null ? acl.Acl.AclMatch.getDefaultInstance() : match_;
} else {
return matchBuilder_.getMessage();
}
}
/**
* <code>.acl.AclMatch match = 3;</code>
*/
public Builder setMatch(acl.Acl.AclMatch value) {
if (matchBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
match_ = value;
onChanged();
} else {
matchBuilder_.setMessage(value);
}
return this;
}
/**
* <code>.acl.AclMatch match = 3;</code>
*/
public Builder setMatch(
acl.Acl.AclMatch.Builder builderForValue) {
if (matchBuilder_ == null) {
match_ = builderForValue.build();
onChanged();
} else {
matchBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <code>.acl.AclMatch match = 3;</code>
*/
public Builder mergeMatch(acl.Acl.AclMatch value) {
if (matchBuilder_ == null) {
if (match_ != null) {
match_ =
acl.Acl.AclMatch.newBuilder(match_).mergeFrom(value).buildPartial();
} else {
match_ = value;
}
onChanged();
} else {
matchBuilder_.mergeFrom(value);
}
return this;
}
/**
* <code>.acl.AclMatch match = 3;</code>
*/
public Builder clearMatch() {
if (matchBuilder_ == null) {
match_ = null;
onChanged();
} else {
match_ = null;
matchBuilder_ = null;
}
return this;
}
/**
* <code>.acl.AclMatch match = 3;</code>
*/
public acl.Acl.AclMatch.Builder getMatchBuilder() {
onChanged();
return getMatchFieldBuilder().getBuilder();
}
/**
* <code>.acl.AclMatch match = 3;</code>
*/
public acl.Acl.AclMatchOrBuilder getMatchOrBuilder() {
if (matchBuilder_ != null) {
return matchBuilder_.getMessageOrBuilder();
} else {
return match_ == null ?
acl.Acl.AclMatch.getDefaultInstance() : match_;
}
}
/**
* <code>.acl.AclMatch match = 3;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
acl.Acl.AclMatch, acl.Acl.AclMatch.Builder, acl.Acl.AclMatchOrBuilder>
getMatchFieldBuilder() {
if (matchBuilder_ == null) {
matchBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
acl.Acl.AclMatch, acl.Acl.AclMatch.Builder, acl.Acl.AclMatchOrBuilder>(
getMatch(),
getParentForChildren(),
isClean());
match_ = null;
}
return matchBuilder_;
}
private acl.Acl.AclAction action_;
private com.google.protobuf.SingleFieldBuilderV3<
acl.Acl.AclAction, acl.Acl.AclAction.Builder, acl.Acl.AclActionOrBuilder> actionBuilder_;
/**
* <code>.acl.AclAction action = 4;</code>
* @return Whether the action field is set.
*/
public boolean hasAction() {
return actionBuilder_ != null || action_ != null;
}
/**
* <code>.acl.AclAction action = 4;</code>
* @return The action.
*/
public acl.Acl.AclAction getAction() {
if (actionBuilder_ == null) {
return action_ == null ? acl.Acl.AclAction.getDefaultInstance() : action_;
} else {
return actionBuilder_.getMessage();
}
}
/**
* <code>.acl.AclAction action = 4;</code>
*/
public Builder setAction(acl.Acl.AclAction value) {
if (actionBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
action_ = value;
onChanged();
} else {
actionBuilder_.setMessage(value);
}
return this;
}
/**
* <code>.acl.AclAction action = 4;</code>
*/
public Builder setAction(
acl.Acl.AclAction.Builder builderForValue) {
if (actionBuilder_ == null) {
action_ = builderForValue.build();
onChanged();
} else {
actionBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <code>.acl.AclAction action = 4;</code>
*/
public Builder mergeAction(acl.Acl.AclAction value) {
if (actionBuilder_ == null) {
if (action_ != null) {
action_ =
acl.Acl.AclAction.newBuilder(action_).mergeFrom(value).buildPartial();
} else {
action_ = value;
}
onChanged();
} else {
actionBuilder_.mergeFrom(value);
}
return this;
}
/**
* <code>.acl.AclAction action = 4;</code>
*/
public Builder clearAction() {
if (actionBuilder_ == null) {
action_ = null;
onChanged();
} else {
action_ = null;
actionBuilder_ = null;
}
return this;
}
/**
* <code>.acl.AclAction action = 4;</code>
*/
public acl.Acl.AclAction.Builder getActionBuilder() {
onChanged();
return getActionFieldBuilder().getBuilder();
}
/**
* <code>.acl.AclAction action = 4;</code>
*/
public acl.Acl.AclActionOrBuilder getActionOrBuilder() {
if (actionBuilder_ != null) {
return actionBuilder_.getMessageOrBuilder();
} else {
return action_ == null ?
acl.Acl.AclAction.getDefaultInstance() : action_;
}
}
/**
* <code>.acl.AclAction action = 4;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
acl.Acl.AclAction, acl.Acl.AclAction.Builder, acl.Acl.AclActionOrBuilder>
getActionFieldBuilder() {
if (actionBuilder_ == null) {
actionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
acl.Acl.AclAction, acl.Acl.AclAction.Builder, acl.Acl.AclActionOrBuilder>(
getAction(),
getParentForChildren(),
isClean());
action_ = null;
}
return actionBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:acl.AclEntry)
}
// @@protoc_insertion_point(class_scope:acl.AclEntry)
private static final acl.Acl.AclEntry DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new acl.Acl.AclEntry();
}
public static acl.Acl.AclEntry getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<AclEntry>
PARSER = new com.google.protobuf.AbstractParser<AclEntry>() {
@java.lang.Override
public AclEntry parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new AclEntry(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<AclEntry> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<AclEntry> getParserForType() {
return PARSER;
}
@java.lang.Override
public acl.Acl.AclEntry getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface AclRuleSetOrBuilder extends
// @@protoc_insertion_point(interface_extends:acl.AclRuleSet)
com.google.protobuf.MessageOrBuilder {
/**
* <code>string name = 1;</code>
* @return The name.
*/
java.lang.String getName();
/**
* <code>string name = 1;</code>
* @return The bytes for name.
*/
com.google.protobuf.ByteString
getNameBytes();
/**
* <code>.acl.AclRuleTypeEnum type = 2;</code>
* @return The enum numeric value on the wire for type.
*/
int getTypeValue();
/**
* <code>.acl.AclRuleTypeEnum type = 2;</code>
* @return The type.
*/
acl.Acl.AclRuleTypeEnum getType();
/**
* <code>string description = 3;</code>
* @return The description.
*/
java.lang.String getDescription();
/**
* <code>string description = 3;</code>
* @return The bytes for description.
*/
com.google.protobuf.ByteString
getDescriptionBytes();
/**
* <code>string user_id = 4;</code>
* @return The userId.
*/
java.lang.String getUserId();
/**
* <code>string user_id = 4;</code>
* @return The bytes for userId.
*/
com.google.protobuf.ByteString
getUserIdBytes();
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
java.util.List<acl.Acl.AclEntry>
getEntriesList();
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
acl.Acl.AclEntry getEntries(int index);
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
int getEntriesCount();
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
java.util.List<? extends acl.Acl.AclEntryOrBuilder>
getEntriesOrBuilderList();
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
acl.Acl.AclEntryOrBuilder getEntriesOrBuilder(
int index);
}
/**
* Protobuf type {@code acl.AclRuleSet}
*/
public static final class AclRuleSet extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:acl.AclRuleSet)
AclRuleSetOrBuilder {
private static final long serialVersionUID = 0L;
// Use AclRuleSet.newBuilder() to construct.
private AclRuleSet(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private AclRuleSet() {
name_ = "";
type_ = 0;
description_ = "";
userId_ = "";
entries_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new AclRuleSet();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private AclRuleSet(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
case 16: {
int rawValue = input.readEnum();
type_ = rawValue;
break;
}
case 26: {
java.lang.String s = input.readStringRequireUtf8();
description_ = s;
break;
}
case 34: {
java.lang.String s = input.readStringRequireUtf8();
userId_ = s;
break;
}
case 42: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
entries_ = new java.util.ArrayList<acl.Acl.AclEntry>();
mutable_bitField0_ |= 0x00000001;
}
entries_.add(
input.readMessage(acl.Acl.AclEntry.parser(), extensionRegistry));
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
entries_ = java.util.Collections.unmodifiableList(entries_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return acl.Acl.internal_static_acl_AclRuleSet_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return acl.Acl.internal_static_acl_AclRuleSet_fieldAccessorTable
.ensureFieldAccessorsInitialized(
acl.Acl.AclRuleSet.class, acl.Acl.AclRuleSet.Builder.class);
}
public static final int NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object name_;
/**
* <code>string name = 1;</code>
* @return The name.
*/
@java.lang.Override
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
* <code>string name = 1;</code>
* @return The bytes for name.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TYPE_FIELD_NUMBER = 2;
private int type_;
/**
* <code>.acl.AclRuleTypeEnum type = 2;</code>
* @return The enum numeric value on the wire for type.
*/
@java.lang.Override public int getTypeValue() {
return type_;
}
/**
* <code>.acl.AclRuleTypeEnum type = 2;</code>
* @return The type.
*/
@java.lang.Override public acl.Acl.AclRuleTypeEnum getType() {
@SuppressWarnings("deprecation")
acl.Acl.AclRuleTypeEnum result = acl.Acl.AclRuleTypeEnum.valueOf(type_);
return result == null ? acl.Acl.AclRuleTypeEnum.UNRECOGNIZED : result;
}
public static final int DESCRIPTION_FIELD_NUMBER = 3;
private volatile java.lang.Object description_;
/**
* <code>string description = 3;</code>
* @return The description.
*/
@java.lang.Override
public java.lang.String getDescription() {
java.lang.Object ref = description_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
description_ = s;
return s;
}
}
/**
* <code>string description = 3;</code>
* @return The bytes for description.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getDescriptionBytes() {
java.lang.Object ref = description_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
description_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int USER_ID_FIELD_NUMBER = 4;
private volatile java.lang.Object userId_;
/**
* <code>string user_id = 4;</code>
* @return The userId.
*/
@java.lang.Override
public java.lang.String getUserId() {
java.lang.Object ref = userId_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
userId_ = s;
return s;
}
}
/**
* <code>string user_id = 4;</code>
* @return The bytes for userId.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getUserIdBytes() {
java.lang.Object ref = userId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
userId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ENTRIES_FIELD_NUMBER = 5;
private java.util.List<acl.Acl.AclEntry> entries_;
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
@java.lang.Override
public java.util.List<acl.Acl.AclEntry> getEntriesList() {
return entries_;
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
@java.lang.Override
public java.util.List<? extends acl.Acl.AclEntryOrBuilder>
getEntriesOrBuilderList() {
return entries_;
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
@java.lang.Override
public int getEntriesCount() {
return entries_.size();
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
@java.lang.Override
public acl.Acl.AclEntry getEntries(int index) {
return entries_.get(index);
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
@java.lang.Override
public acl.Acl.AclEntryOrBuilder getEntriesOrBuilder(
int index) {
return entries_.get(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
if (type_ != acl.Acl.AclRuleTypeEnum.ACLRULETYPE_UNDEFINED.getNumber()) {
output.writeEnum(2, type_);
}
if (!getDescriptionBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_);
}
if (!getUserIdBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, userId_);
}
for (int i = 0; i < entries_.size(); i++) {
output.writeMessage(5, entries_.get(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
if (type_ != acl.Acl.AclRuleTypeEnum.ACLRULETYPE_UNDEFINED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, type_);
}
if (!getDescriptionBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_);
}
if (!getUserIdBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, userId_);
}
for (int i = 0; i < entries_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, entries_.get(i));
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof acl.Acl.AclRuleSet)) {
return super.equals(obj);
}
acl.Acl.AclRuleSet other = (acl.Acl.AclRuleSet) obj;
if (!getName()
.equals(other.getName())) return false;
if (type_ != other.type_) return false;
if (!getDescription()
.equals(other.getDescription())) return false;
if (!getUserId()
.equals(other.getUserId())) return false;
if (!getEntriesList()
.equals(other.getEntriesList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + type_;
hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER;
hash = (53 * hash) + getDescription().hashCode();
hash = (37 * hash) + USER_ID_FIELD_NUMBER;
hash = (53 * hash) + getUserId().hashCode();
if (getEntriesCount() > 0) {
hash = (37 * hash) + ENTRIES_FIELD_NUMBER;
hash = (53 * hash) + getEntriesList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static acl.Acl.AclRuleSet parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static acl.Acl.AclRuleSet parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static acl.Acl.AclRuleSet parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static acl.Acl.AclRuleSet parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static acl.Acl.AclRuleSet parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static acl.Acl.AclRuleSet parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static acl.Acl.AclRuleSet parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static acl.Acl.AclRuleSet parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static acl.Acl.AclRuleSet parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static acl.Acl.AclRuleSet parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static acl.Acl.AclRuleSet parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static acl.Acl.AclRuleSet parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(acl.Acl.AclRuleSet prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code acl.AclRuleSet}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:acl.AclRuleSet)
acl.Acl.AclRuleSetOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return acl.Acl.internal_static_acl_AclRuleSet_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return acl.Acl.internal_static_acl_AclRuleSet_fieldAccessorTable
.ensureFieldAccessorsInitialized(
acl.Acl.AclRuleSet.class, acl.Acl.AclRuleSet.Builder.class);
}
// Construct using acl.Acl.AclRuleSet.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getEntriesFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
name_ = "";
type_ = 0;
description_ = "";
userId_ = "";
if (entriesBuilder_ == null) {
entries_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
entriesBuilder_.clear();
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return acl.Acl.internal_static_acl_AclRuleSet_descriptor;
}
@java.lang.Override
public acl.Acl.AclRuleSet getDefaultInstanceForType() {
return acl.Acl.AclRuleSet.getDefaultInstance();
}
@java.lang.Override
public acl.Acl.AclRuleSet build() {
acl.Acl.AclRuleSet result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public acl.Acl.AclRuleSet buildPartial() {
acl.Acl.AclRuleSet result = new acl.Acl.AclRuleSet(this);
int from_bitField0_ = bitField0_;
result.name_ = name_;
result.type_ = type_;
result.description_ = description_;
result.userId_ = userId_;
if (entriesBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
entries_ = java.util.Collections.unmodifiableList(entries_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.entries_ = entries_;
} else {
result.entries_ = entriesBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof acl.Acl.AclRuleSet) {
return mergeFrom((acl.Acl.AclRuleSet)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(acl.Acl.AclRuleSet other) {
if (other == acl.Acl.AclRuleSet.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
if (other.type_ != 0) {
setTypeValue(other.getTypeValue());
}
if (!other.getDescription().isEmpty()) {
description_ = other.description_;
onChanged();
}
if (!other.getUserId().isEmpty()) {
userId_ = other.userId_;
onChanged();
}
if (entriesBuilder_ == null) {
if (!other.entries_.isEmpty()) {
if (entries_.isEmpty()) {
entries_ = other.entries_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureEntriesIsMutable();
entries_.addAll(other.entries_);
}
onChanged();
}
} else {
if (!other.entries_.isEmpty()) {
if (entriesBuilder_.isEmpty()) {
entriesBuilder_.dispose();
entriesBuilder_ = null;
entries_ = other.entries_;
bitField0_ = (bitField0_ & ~0x00000001);
entriesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getEntriesFieldBuilder() : null;
} else {
entriesBuilder_.addAllMessages(other.entries_);
}
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
acl.Acl.AclRuleSet parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (acl.Acl.AclRuleSet) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object name_ = "";
/**
* <code>string name = 1;</code>
* @return The name.
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string name = 1;</code>
* @return The bytes for name.
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string name = 1;</code>
* @param value The name to set.
* @return This builder for chaining.
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
* <code>string name = 1;</code>
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
* <code>string name = 1;</code>
* @param value The bytes for name to set.
* @return This builder for chaining.
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
private int type_ = 0;
/**
* <code>.acl.AclRuleTypeEnum type = 2;</code>
* @return The enum numeric value on the wire for type.
*/
@java.lang.Override public int getTypeValue() {
return type_;
}
/**
* <code>.acl.AclRuleTypeEnum type = 2;</code>
* @param value The enum numeric value on the wire for type to set.
* @return This builder for chaining.
*/
public Builder setTypeValue(int value) {
type_ = value;
onChanged();
return this;
}
/**
* <code>.acl.AclRuleTypeEnum type = 2;</code>
* @return The type.
*/
@java.lang.Override
public acl.Acl.AclRuleTypeEnum getType() {
@SuppressWarnings("deprecation")
acl.Acl.AclRuleTypeEnum result = acl.Acl.AclRuleTypeEnum.valueOf(type_);
return result == null ? acl.Acl.AclRuleTypeEnum.UNRECOGNIZED : result;
}
/**
* <code>.acl.AclRuleTypeEnum type = 2;</code>
* @param value The type to set.
* @return This builder for chaining.
*/
public Builder setType(acl.Acl.AclRuleTypeEnum value) {
if (value == null) {
throw new NullPointerException();
}
type_ = value.getNumber();
onChanged();
return this;
}
/**
* <code>.acl.AclRuleTypeEnum type = 2;</code>
* @return This builder for chaining.
*/
public Builder clearType() {
type_ = 0;
onChanged();
return this;
}
private java.lang.Object description_ = "";
/**
* <code>string description = 3;</code>
* @return The description.
*/
public java.lang.String getDescription() {
java.lang.Object ref = description_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
description_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string description = 3;</code>
* @return The bytes for description.
*/
public com.google.protobuf.ByteString
getDescriptionBytes() {
java.lang.Object ref = description_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
description_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string description = 3;</code>
* @param value The description to set.
* @return This builder for chaining.
*/
public Builder setDescription(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
description_ = value;
onChanged();
return this;
}
/**
* <code>string description = 3;</code>
* @return This builder for chaining.
*/
public Builder clearDescription() {
description_ = getDefaultInstance().getDescription();
onChanged();
return this;
}
/**
* <code>string description = 3;</code>
* @param value The bytes for description to set.
* @return This builder for chaining.
*/
public Builder setDescriptionBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
description_ = value;
onChanged();
return this;
}
private java.lang.Object userId_ = "";
/**
* <code>string user_id = 4;</code>
* @return The userId.
*/
public java.lang.String getUserId() {
java.lang.Object ref = userId_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
userId_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>string user_id = 4;</code>
* @return The bytes for userId.
*/
public com.google.protobuf.ByteString
getUserIdBytes() {
java.lang.Object ref = userId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
userId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>string user_id = 4;</code>
* @param value The userId to set.
* @return This builder for chaining.
*/
public Builder setUserId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
userId_ = value;
onChanged();
return this;
}
/**
* <code>string user_id = 4;</code>
* @return This builder for chaining.
*/
public Builder clearUserId() {
userId_ = getDefaultInstance().getUserId();
onChanged();
return this;
}
/**
* <code>string user_id = 4;</code>
* @param value The bytes for userId to set.
* @return This builder for chaining.
*/
public Builder setUserIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
userId_ = value;
onChanged();
return this;
}
private java.util.List<acl.Acl.AclEntry> entries_ =
java.util.Collections.emptyList();
private void ensureEntriesIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
entries_ = new java.util.ArrayList<acl.Acl.AclEntry>(entries_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
acl.Acl.AclEntry, acl.Acl.AclEntry.Builder, acl.Acl.AclEntryOrBuilder> entriesBuilder_;
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public java.util.List<acl.Acl.AclEntry> getEntriesList() {
if (entriesBuilder_ == null) {
return java.util.Collections.unmodifiableList(entries_);
} else {
return entriesBuilder_.getMessageList();
}
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public int getEntriesCount() {
if (entriesBuilder_ == null) {
return entries_.size();
} else {
return entriesBuilder_.getCount();
}
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public acl.Acl.AclEntry getEntries(int index) {
if (entriesBuilder_ == null) {
return entries_.get(index);
} else {
return entriesBuilder_.getMessage(index);
}
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public Builder setEntries(
int index, acl.Acl.AclEntry value) {
if (entriesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureEntriesIsMutable();
entries_.set(index, value);
onChanged();
} else {
entriesBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public Builder setEntries(
int index, acl.Acl.AclEntry.Builder builderForValue) {
if (entriesBuilder_ == null) {
ensureEntriesIsMutable();
entries_.set(index, builderForValue.build());
onChanged();
} else {
entriesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public Builder addEntries(acl.Acl.AclEntry value) {
if (entriesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureEntriesIsMutable();
entries_.add(value);
onChanged();
} else {
entriesBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public Builder addEntries(
int index, acl.Acl.AclEntry value) {
if (entriesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureEntriesIsMutable();
entries_.add(index, value);
onChanged();
} else {
entriesBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public Builder addEntries(
acl.Acl.AclEntry.Builder builderForValue) {
if (entriesBuilder_ == null) {
ensureEntriesIsMutable();
entries_.add(builderForValue.build());
onChanged();
} else {
entriesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public Builder addEntries(
int index, acl.Acl.AclEntry.Builder builderForValue) {
if (entriesBuilder_ == null) {
ensureEntriesIsMutable();
entries_.add(index, builderForValue.build());
onChanged();
} else {
entriesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public Builder addAllEntries(
java.lang.Iterable<? extends acl.Acl.AclEntry> values) {
if (entriesBuilder_ == null) {
ensureEntriesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, entries_);
onChanged();
} else {
entriesBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public Builder clearEntries() {
if (entriesBuilder_ == null) {
entries_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
entriesBuilder_.clear();
}
return this;
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public Builder removeEntries(int index) {
if (entriesBuilder_ == null) {
ensureEntriesIsMutable();
entries_.remove(index);
onChanged();
} else {
entriesBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public acl.Acl.AclEntry.Builder getEntriesBuilder(
int index) {
return getEntriesFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public acl.Acl.AclEntryOrBuilder getEntriesOrBuilder(
int index) {
if (entriesBuilder_ == null) {
return entries_.get(index); } else {
return entriesBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public java.util.List<? extends acl.Acl.AclEntryOrBuilder>
getEntriesOrBuilderList() {
if (entriesBuilder_ != null) {
return entriesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(entries_);
}
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public acl.Acl.AclEntry.Builder addEntriesBuilder() {
return getEntriesFieldBuilder().addBuilder(
acl.Acl.AclEntry.getDefaultInstance());
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public acl.Acl.AclEntry.Builder addEntriesBuilder(
int index) {
return getEntriesFieldBuilder().addBuilder(
index, acl.Acl.AclEntry.getDefaultInstance());
}
/**
* <code>repeated .acl.AclEntry entries = 5;</code>
*/
public java.util.List<acl.Acl.AclEntry.Builder>
getEntriesBuilderList() {
return getEntriesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
acl.Acl.AclEntry, acl.Acl.AclEntry.Builder, acl.Acl.AclEntryOrBuilder>
getEntriesFieldBuilder() {
if (entriesBuilder_ == null) {
entriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
acl.Acl.AclEntry, acl.Acl.AclEntry.Builder, acl.Acl.AclEntryOrBuilder>(
entries_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
entries_ = null;
}
return entriesBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:acl.AclRuleSet)
}
// @@protoc_insertion_point(class_scope:acl.AclRuleSet)
private static final acl.Acl.AclRuleSet DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new acl.Acl.AclRuleSet();
}
public static acl.Acl.AclRuleSet getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<AclRuleSet>
PARSER = new com.google.protobuf.AbstractParser<AclRuleSet>() {
@java.lang.Override
public AclRuleSet parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new AclRuleSet(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<AclRuleSet> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<AclRuleSet> getParserForType() {
return PARSER;
}
@java.lang.Override
public acl.Acl.AclRuleSet getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_acl_AclMatch_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_acl_AclMatch_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_acl_AclAction_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_acl_AclAction_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_acl_AclEntry_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_acl_AclEntry_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_acl_AclRuleSet_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_acl_AclRuleSet_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\tacl.proto\022\003acl\"\252\001\n\010AclMatch\022\014\n\004dscp\030\001 " +
"\001(\r\022\020\n\010protocol\030\002 \001(\r\022\023\n\013src_address\030\003 \001" +
"(\t\022\023\n\013dst_address\030\004 \001(\t\022\020\n\010src_port\030\005 \001(" +
"\r\022\020\n\010dst_port\030\006 \001(\r\022\030\n\020start_mpls_label\030" +
"\007 \001(\r\022\026\n\016end_mpls_label\030\010 \001(\r\"i\n\tAclActi" +
"on\0221\n\016forward_action\030\001 \001(\0162\031.acl.AclForw" +
"ardActionEnum\022)\n\nlog_action\030\002 \001(\0162\025.acl." +
"AclLogActionEnum\"r\n\010AclEntry\022\023\n\013sequence" +
"_id\030\001 \001(\r\022\023\n\013description\030\002 \001(\t\022\034\n\005match\030" +
"\003 \001(\0132\r.acl.AclMatch\022\036\n\006action\030\004 \001(\0132\016.a" +
"cl.AclAction\"\204\001\n\nAclRuleSet\022\014\n\004name\030\001 \001(" +
"\t\022\"\n\004type\030\002 \001(\0162\024.acl.AclRuleTypeEnum\022\023\n" +
"\013description\030\003 \001(\t\022\017\n\007user_id\030\004 \001(\t\022\036\n\007e" +
"ntries\030\005 \003(\0132\r.acl.AclEntry*\231\001\n\017AclRuleT" +
"ypeEnum\022\031\n\025ACLRULETYPE_UNDEFINED\020\000\022\024\n\020AC" +
"LRULETYPE_IPV4\020\001\022\024\n\020ACLRULETYPE_IPV6\020\002\022\022" +
"\n\016ACLRULETYPE_L2\020\003\022\024\n\020ACLRULETYPE_MPLS\020\004" +
"\022\025\n\021ACLRULETYPE_MIXED\020\005*\227\001\n\024AclForwardAc" +
"tionEnum\022!\n\035ACLFORWARDINGACTION_UNDEFINE" +
"D\020\000\022\034\n\030ACLFORWARDINGACTION_DROP\020\001\022\036\n\032ACL" +
"FORWARDINGACTION_ACCEPT\020\002\022\036\n\032ACLFORWARDI" +
"NGACTION_REJECT\020\003*_\n\020AclLogActionEnum\022\032\n" +
"\026ACLLOGACTION_UNDEFINED\020\000\022\026\n\022ACLLOGACTIO" +
"N_NOLOG\020\001\022\027\n\023ACLLOGACTION_SYSLOG\020\002b\006prot" +
"o3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_acl_AclMatch_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_acl_AclMatch_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_acl_AclMatch_descriptor,
new java.lang.String[] { "Dscp", "Protocol", "SrcAddress", "DstAddress", "SrcPort", "DstPort", "StartMplsLabel", "EndMplsLabel", });
internal_static_acl_AclAction_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_acl_AclAction_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_acl_AclAction_descriptor,
new java.lang.String[] { "ForwardAction", "LogAction", });
internal_static_acl_AclEntry_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_acl_AclEntry_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_acl_AclEntry_descriptor,
new java.lang.String[] { "SequenceId", "Description", "Match", "Action", });
internal_static_acl_AclRuleSet_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_acl_AclRuleSet_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_acl_AclRuleSet_descriptor,
new java.lang.String[] { "Name", "Type", "Description", "UserId", "Entries", });
}
// @@protoc_insertion_point(outer_class_scope)
}
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: automation.proto
package automation;
public final class Automation {
private Automation() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
/**
* Protobuf enum {@code automation.DeviceRoleType}
*/
public enum DeviceRoleType
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>NONE = 0;</code>
*/
NONE(0),
/**
* <code>DEV_OPS = 1;</code>
*/
DEV_OPS(1),
/**
* <code>DEV_CONF = 2;</code>
*/
DEV_CONF(2),
/**
* <code>PIPELINE_CONF = 3;</code>
*/
PIPELINE_CONF(3),
UNRECOGNIZED(-1),
;
/**
* <code>NONE = 0;</code>
*/
public static final int NONE_VALUE = 0;
/**
* <code>DEV_OPS = 1;</code>
*/
public static final int DEV_OPS_VALUE = 1;
/**
* <code>DEV_CONF = 2;</code>
*/
public static final int DEV_CONF_VALUE = 2;
/**
* <code>PIPELINE_CONF = 3;</code>
*/
public static final int PIPELINE_CONF_VALUE = 3;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static DeviceRoleType valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static DeviceRoleType forNumber(int value) {
switch (value) {
case 0: return NONE;
case 1: return DEV_OPS;
case 2: return DEV_CONF;
case 3: return PIPELINE_CONF;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<DeviceRoleType>
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
DeviceRoleType> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<DeviceRoleType>() {
public DeviceRoleType findValueByNumber(int number) {
return DeviceRoleType.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return automation.Automation.getDescriptor().getEnumTypes().get(0);
}
private static final DeviceRoleType[] VALUES = values();
public static DeviceRoleType valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private DeviceRoleType(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:automation.DeviceRoleType)
}
/**
* Protobuf enum {@code automation.ZtpDeviceState}
*/
public enum ZtpDeviceState
implements com.google.protobuf.ProtocolMessageEnum {
/**
* <code>ZTP_DEV_STATE_UNDEFINED = 0;</code>
*/
ZTP_DEV_STATE_UNDEFINED(0),
/**
* <code>ZTP_DEV_STATE_CREATED = 1;</code>
*/
ZTP_DEV_STATE_CREATED(1),
/**
* <code>ZTP_DEV_STATE_UPDATED = 2;</code>
*/
ZTP_DEV_STATE_UPDATED(2),
/**
* <code>ZTP_DEV_STATE_DELETED = 3;</code>
*/
ZTP_DEV_STATE_DELETED(3),
UNRECOGNIZED(-1),
;
/**
* <code>ZTP_DEV_STATE_UNDEFINED = 0;</code>
*/
public static final int ZTP_DEV_STATE_UNDEFINED_VALUE = 0;
/**
* <code>ZTP_DEV_STATE_CREATED = 1;</code>
*/
public static final int ZTP_DEV_STATE_CREATED_VALUE = 1;
/**
* <code>ZTP_DEV_STATE_UPDATED = 2;</code>
*/
public static final int ZTP_DEV_STATE_UPDATED_VALUE = 2;
/**
* <code>ZTP_DEV_STATE_DELETED = 3;</code>
*/
public static final int ZTP_DEV_STATE_DELETED_VALUE = 3;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static ZtpDeviceState valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static ZtpDeviceState forNumber(int value) {
switch (value) {
case 0: return ZTP_DEV_STATE_UNDEFINED;
case 1: return ZTP_DEV_STATE_CREATED;
case 2: return ZTP_DEV_STATE_UPDATED;
case 3: return ZTP_DEV_STATE_DELETED;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap<ZtpDeviceState>
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
ZtpDeviceState> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap<ZtpDeviceState>() {
public ZtpDeviceState findValueByNumber(int number) {
return ZtpDeviceState.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return automation.Automation.getDescriptor().getEnumTypes().get(1);
}
private static final ZtpDeviceState[] VALUES = values();
public static ZtpDeviceState valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private ZtpDeviceState(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:automation.ZtpDeviceState)
}
public interface DeviceRoleIdOrBuilder extends
// @@protoc_insertion_point(interface_extends:automation.DeviceRoleId)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.context.Uuid devRoleId = 1;</code>
* @return Whether the devRoleId field is set.
*/
boolean hasDevRoleId();
/**
* <code>.context.Uuid devRoleId = 1;</code>
* @return The devRoleId.
*/
context.ContextOuterClass.Uuid getDevRoleId();
/**
* <code>.context.Uuid devRoleId = 1;</code>
*/
context.ContextOuterClass.UuidOrBuilder getDevRoleIdOrBuilder();
/**
* <code>.context.DeviceId devId = 2;</code>
* @return Whether the devId field is set.
*/
boolean hasDevId();
/**
* <code>.context.DeviceId devId = 2;</code>
* @return The devId.
*/
context.ContextOuterClass.DeviceId getDevId();
/**
* <code>.context.DeviceId devId = 2;</code>
*/
context.ContextOuterClass.DeviceIdOrBuilder getDevIdOrBuilder();
}
/**
* Protobuf type {@code automation.DeviceRoleId}
*/
public static final class DeviceRoleId extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:automation.DeviceRoleId)
DeviceRoleIdOrBuilder {
private static final long serialVersionUID = 0L;
// Use DeviceRoleId.newBuilder() to construct.
private DeviceRoleId(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DeviceRoleId() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DeviceRoleId();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DeviceRoleId(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
context.ContextOuterClass.Uuid.Builder subBuilder = null;
if (devRoleId_ != null) {
subBuilder = devRoleId_.toBuilder();
}
devRoleId_ = input.readMessage(context.ContextOuterClass.Uuid.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(devRoleId_);
devRoleId_ = subBuilder.buildPartial();
}
break;
}
case 18: {
context.ContextOuterClass.DeviceId.Builder subBuilder = null;
if (devId_ != null) {
subBuilder = devId_.toBuilder();
}
devId_ = input.readMessage(context.ContextOuterClass.DeviceId.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(devId_);
devId_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return automation.Automation.internal_static_automation_DeviceRoleId_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return automation.Automation.internal_static_automation_DeviceRoleId_fieldAccessorTable
.ensureFieldAccessorsInitialized(
automation.Automation.DeviceRoleId.class, automation.Automation.DeviceRoleId.Builder.class);
}
public static final int DEVROLEID_FIELD_NUMBER = 1;
private context.ContextOuterClass.Uuid devRoleId_;
/**
* <code>.context.Uuid devRoleId = 1;</code>
* @return Whether the devRoleId field is set.
*/
@java.lang.Override
public boolean hasDevRoleId() {
return devRoleId_ != null;
}
/**
* <code>.context.Uuid devRoleId = 1;</code>
* @return The devRoleId.
*/
@java.lang.Override
public context.ContextOuterClass.Uuid getDevRoleId() {
return devRoleId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : devRoleId_;
}
/**
* <code>.context.Uuid devRoleId = 1;</code>
*/
@java.lang.Override
public context.ContextOuterClass.UuidOrBuilder getDevRoleIdOrBuilder() {
return getDevRoleId();
}
public static final int DEVID_FIELD_NUMBER = 2;
private context.ContextOuterClass.DeviceId devId_;
/**
* <code>.context.DeviceId devId = 2;</code>
* @return Whether the devId field is set.
*/
@java.lang.Override
public boolean hasDevId() {
return devId_ != null;
}
/**
* <code>.context.DeviceId devId = 2;</code>
* @return The devId.
*/
@java.lang.Override
public context.ContextOuterClass.DeviceId getDevId() {
return devId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : devId_;
}
/**
* <code>.context.DeviceId devId = 2;</code>
*/
@java.lang.Override
public context.ContextOuterClass.DeviceIdOrBuilder getDevIdOrBuilder() {
return getDevId();
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (devRoleId_ != null) {
output.writeMessage(1, getDevRoleId());
}
if (devId_ != null) {
output.writeMessage(2, getDevId());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (devRoleId_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getDevRoleId());
}
if (devId_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getDevId());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof automation.Automation.DeviceRoleId)) {
return super.equals(obj);
}
automation.Automation.DeviceRoleId other = (automation.Automation.DeviceRoleId) obj;
if (hasDevRoleId() != other.hasDevRoleId()) return false;
if (hasDevRoleId()) {
if (!getDevRoleId()
.equals(other.getDevRoleId())) return false;
}
if (hasDevId() != other.hasDevId()) return false;
if (hasDevId()) {
if (!getDevId()
.equals(other.getDevId())) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasDevRoleId()) {
hash = (37 * hash) + DEVROLEID_FIELD_NUMBER;
hash = (53 * hash) + getDevRoleId().hashCode();
}
if (hasDevId()) {
hash = (37 * hash) + DEVID_FIELD_NUMBER;
hash = (53 * hash) + getDevId().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static automation.Automation.DeviceRoleId parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceRoleId parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceRoleId parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceRoleId parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceRoleId parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceRoleId parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceRoleId parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static automation.Automation.DeviceRoleId parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static automation.Automation.DeviceRoleId parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static automation.Automation.DeviceRoleId parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static automation.Automation.DeviceRoleId parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static automation.Automation.DeviceRoleId parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(automation.Automation.DeviceRoleId prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code automation.DeviceRoleId}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:automation.DeviceRoleId)
automation.Automation.DeviceRoleIdOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return automation.Automation.internal_static_automation_DeviceRoleId_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return automation.Automation.internal_static_automation_DeviceRoleId_fieldAccessorTable
.ensureFieldAccessorsInitialized(
automation.Automation.DeviceRoleId.class, automation.Automation.DeviceRoleId.Builder.class);
}
// Construct using automation.Automation.DeviceRoleId.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (devRoleIdBuilder_ == null) {
devRoleId_ = null;
} else {
devRoleId_ = null;
devRoleIdBuilder_ = null;
}
if (devIdBuilder_ == null) {
devId_ = null;
} else {
devId_ = null;
devIdBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return automation.Automation.internal_static_automation_DeviceRoleId_descriptor;
}
@java.lang.Override
public automation.Automation.DeviceRoleId getDefaultInstanceForType() {
return automation.Automation.DeviceRoleId.getDefaultInstance();
}
@java.lang.Override
public automation.Automation.DeviceRoleId build() {
automation.Automation.DeviceRoleId result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public automation.Automation.DeviceRoleId buildPartial() {
automation.Automation.DeviceRoleId result = new automation.Automation.DeviceRoleId(this);
if (devRoleIdBuilder_ == null) {
result.devRoleId_ = devRoleId_;
} else {
result.devRoleId_ = devRoleIdBuilder_.build();
}
if (devIdBuilder_ == null) {
result.devId_ = devId_;
} else {
result.devId_ = devIdBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof automation.Automation.DeviceRoleId) {
return mergeFrom((automation.Automation.DeviceRoleId)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(automation.Automation.DeviceRoleId other) {
if (other == automation.Automation.DeviceRoleId.getDefaultInstance()) return this;
if (other.hasDevRoleId()) {
mergeDevRoleId(other.getDevRoleId());
}
if (other.hasDevId()) {
mergeDevId(other.getDevId());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
automation.Automation.DeviceRoleId parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (automation.Automation.DeviceRoleId) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private context.ContextOuterClass.Uuid devRoleId_;
private com.google.protobuf.SingleFieldBuilderV3<
context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder> devRoleIdBuilder_;
/**
* <code>.context.Uuid devRoleId = 1;</code>
* @return Whether the devRoleId field is set.
*/
public boolean hasDevRoleId() {
return devRoleIdBuilder_ != null || devRoleId_ != null;
}
/**
* <code>.context.Uuid devRoleId = 1;</code>
* @return The devRoleId.
*/
public context.ContextOuterClass.Uuid getDevRoleId() {
if (devRoleIdBuilder_ == null) {
return devRoleId_ == null ? context.ContextOuterClass.Uuid.getDefaultInstance() : devRoleId_;
} else {
return devRoleIdBuilder_.getMessage();
}
}
/**
* <code>.context.Uuid devRoleId = 1;</code>
*/
public Builder setDevRoleId(context.ContextOuterClass.Uuid value) {
if (devRoleIdBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
devRoleId_ = value;
onChanged();
} else {
devRoleIdBuilder_.setMessage(value);
}
return this;
}
/**
* <code>.context.Uuid devRoleId = 1;</code>
*/
public Builder setDevRoleId(
context.ContextOuterClass.Uuid.Builder builderForValue) {
if (devRoleIdBuilder_ == null) {
devRoleId_ = builderForValue.build();
onChanged();
} else {
devRoleIdBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <code>.context.Uuid devRoleId = 1;</code>
*/
public Builder mergeDevRoleId(context.ContextOuterClass.Uuid value) {
if (devRoleIdBuilder_ == null) {
if (devRoleId_ != null) {
devRoleId_ =
context.ContextOuterClass.Uuid.newBuilder(devRoleId_).mergeFrom(value).buildPartial();
} else {
devRoleId_ = value;
}
onChanged();
} else {
devRoleIdBuilder_.mergeFrom(value);
}
return this;
}
/**
* <code>.context.Uuid devRoleId = 1;</code>
*/
public Builder clearDevRoleId() {
if (devRoleIdBuilder_ == null) {
devRoleId_ = null;
onChanged();
} else {
devRoleId_ = null;
devRoleIdBuilder_ = null;
}
return this;
}
/**
* <code>.context.Uuid devRoleId = 1;</code>
*/
public context.ContextOuterClass.Uuid.Builder getDevRoleIdBuilder() {
onChanged();
return getDevRoleIdFieldBuilder().getBuilder();
}
/**
* <code>.context.Uuid devRoleId = 1;</code>
*/
public context.ContextOuterClass.UuidOrBuilder getDevRoleIdOrBuilder() {
if (devRoleIdBuilder_ != null) {
return devRoleIdBuilder_.getMessageOrBuilder();
} else {
return devRoleId_ == null ?
context.ContextOuterClass.Uuid.getDefaultInstance() : devRoleId_;
}
}
/**
* <code>.context.Uuid devRoleId = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>
getDevRoleIdFieldBuilder() {
if (devRoleIdBuilder_ == null) {
devRoleIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
context.ContextOuterClass.Uuid, context.ContextOuterClass.Uuid.Builder, context.ContextOuterClass.UuidOrBuilder>(
getDevRoleId(),
getParentForChildren(),
isClean());
devRoleId_ = null;
}
return devRoleIdBuilder_;
}
private context.ContextOuterClass.DeviceId devId_;
private com.google.protobuf.SingleFieldBuilderV3<
context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder> devIdBuilder_;
/**
* <code>.context.DeviceId devId = 2;</code>
* @return Whether the devId field is set.
*/
public boolean hasDevId() {
return devIdBuilder_ != null || devId_ != null;
}
/**
* <code>.context.DeviceId devId = 2;</code>
* @return The devId.
*/
public context.ContextOuterClass.DeviceId getDevId() {
if (devIdBuilder_ == null) {
return devId_ == null ? context.ContextOuterClass.DeviceId.getDefaultInstance() : devId_;
} else {
return devIdBuilder_.getMessage();
}
}
/**
* <code>.context.DeviceId devId = 2;</code>
*/
public Builder setDevId(context.ContextOuterClass.DeviceId value) {
if (devIdBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
devId_ = value;
onChanged();
} else {
devIdBuilder_.setMessage(value);
}
return this;
}
/**
* <code>.context.DeviceId devId = 2;</code>
*/
public Builder setDevId(
context.ContextOuterClass.DeviceId.Builder builderForValue) {
if (devIdBuilder_ == null) {
devId_ = builderForValue.build();
onChanged();
} else {
devIdBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <code>.context.DeviceId devId = 2;</code>
*/
public Builder mergeDevId(context.ContextOuterClass.DeviceId value) {
if (devIdBuilder_ == null) {
if (devId_ != null) {
devId_ =
context.ContextOuterClass.DeviceId.newBuilder(devId_).mergeFrom(value).buildPartial();
} else {
devId_ = value;
}
onChanged();
} else {
devIdBuilder_.mergeFrom(value);
}
return this;
}
/**
* <code>.context.DeviceId devId = 2;</code>
*/
public Builder clearDevId() {
if (devIdBuilder_ == null) {
devId_ = null;
onChanged();
} else {
devId_ = null;
devIdBuilder_ = null;
}
return this;
}
/**
* <code>.context.DeviceId devId = 2;</code>
*/
public context.ContextOuterClass.DeviceId.Builder getDevIdBuilder() {
onChanged();
return getDevIdFieldBuilder().getBuilder();
}
/**
* <code>.context.DeviceId devId = 2;</code>
*/
public context.ContextOuterClass.DeviceIdOrBuilder getDevIdOrBuilder() {
if (devIdBuilder_ != null) {
return devIdBuilder_.getMessageOrBuilder();
} else {
return devId_ == null ?
context.ContextOuterClass.DeviceId.getDefaultInstance() : devId_;
}
}
/**
* <code>.context.DeviceId devId = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>
getDevIdFieldBuilder() {
if (devIdBuilder_ == null) {
devIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
context.ContextOuterClass.DeviceId, context.ContextOuterClass.DeviceId.Builder, context.ContextOuterClass.DeviceIdOrBuilder>(
getDevId(),
getParentForChildren(),
isClean());
devId_ = null;
}
return devIdBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:automation.DeviceRoleId)
}
// @@protoc_insertion_point(class_scope:automation.DeviceRoleId)
private static final automation.Automation.DeviceRoleId DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new automation.Automation.DeviceRoleId();
}
public static automation.Automation.DeviceRoleId getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DeviceRoleId>
PARSER = new com.google.protobuf.AbstractParser<DeviceRoleId>() {
@java.lang.Override
public DeviceRoleId parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DeviceRoleId(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<DeviceRoleId> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<DeviceRoleId> getParserForType() {
return PARSER;
}
@java.lang.Override
public automation.Automation.DeviceRoleId getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface DeviceRoleOrBuilder extends
// @@protoc_insertion_point(interface_extends:automation.DeviceRole)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
* @return Whether the devRoleId field is set.
*/
boolean hasDevRoleId();
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
* @return The devRoleId.
*/
automation.Automation.DeviceRoleId getDevRoleId();
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder();
/**
* <code>.automation.DeviceRoleType devRoleType = 2;</code>
* @return The enum numeric value on the wire for devRoleType.
*/
int getDevRoleTypeValue();
/**
* <code>.automation.DeviceRoleType devRoleType = 2;</code>
* @return The devRoleType.
*/
automation.Automation.DeviceRoleType getDevRoleType();
}
/**
* Protobuf type {@code automation.DeviceRole}
*/
public static final class DeviceRole extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:automation.DeviceRole)
DeviceRoleOrBuilder {
private static final long serialVersionUID = 0L;
// Use DeviceRole.newBuilder() to construct.
private DeviceRole(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DeviceRole() {
devRoleType_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DeviceRole();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DeviceRole(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
automation.Automation.DeviceRoleId.Builder subBuilder = null;
if (devRoleId_ != null) {
subBuilder = devRoleId_.toBuilder();
}
devRoleId_ = input.readMessage(automation.Automation.DeviceRoleId.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(devRoleId_);
devRoleId_ = subBuilder.buildPartial();
}
break;
}
case 16: {
int rawValue = input.readEnum();
devRoleType_ = rawValue;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return automation.Automation.internal_static_automation_DeviceRole_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return automation.Automation.internal_static_automation_DeviceRole_fieldAccessorTable
.ensureFieldAccessorsInitialized(
automation.Automation.DeviceRole.class, automation.Automation.DeviceRole.Builder.class);
}
public static final int DEVROLEID_FIELD_NUMBER = 1;
private automation.Automation.DeviceRoleId devRoleId_;
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
* @return Whether the devRoleId field is set.
*/
@java.lang.Override
public boolean hasDevRoleId() {
return devRoleId_ != null;
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
* @return The devRoleId.
*/
@java.lang.Override
public automation.Automation.DeviceRoleId getDevRoleId() {
return devRoleId_ == null ? automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
@java.lang.Override
public automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() {
return getDevRoleId();
}
public static final int DEVROLETYPE_FIELD_NUMBER = 2;
private int devRoleType_;
/**
* <code>.automation.DeviceRoleType devRoleType = 2;</code>
* @return The enum numeric value on the wire for devRoleType.
*/
@java.lang.Override public int getDevRoleTypeValue() {
return devRoleType_;
}
/**
* <code>.automation.DeviceRoleType devRoleType = 2;</code>
* @return The devRoleType.
*/
@java.lang.Override public automation.Automation.DeviceRoleType getDevRoleType() {
@SuppressWarnings("deprecation")
automation.Automation.DeviceRoleType result = automation.Automation.DeviceRoleType.valueOf(devRoleType_);
return result == null ? automation.Automation.DeviceRoleType.UNRECOGNIZED : result;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (devRoleId_ != null) {
output.writeMessage(1, getDevRoleId());
}
if (devRoleType_ != automation.Automation.DeviceRoleType.NONE.getNumber()) {
output.writeEnum(2, devRoleType_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (devRoleId_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getDevRoleId());
}
if (devRoleType_ != automation.Automation.DeviceRoleType.NONE.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, devRoleType_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof automation.Automation.DeviceRole)) {
return super.equals(obj);
}
automation.Automation.DeviceRole other = (automation.Automation.DeviceRole) obj;
if (hasDevRoleId() != other.hasDevRoleId()) return false;
if (hasDevRoleId()) {
if (!getDevRoleId()
.equals(other.getDevRoleId())) return false;
}
if (devRoleType_ != other.devRoleType_) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasDevRoleId()) {
hash = (37 * hash) + DEVROLEID_FIELD_NUMBER;
hash = (53 * hash) + getDevRoleId().hashCode();
}
hash = (37 * hash) + DEVROLETYPE_FIELD_NUMBER;
hash = (53 * hash) + devRoleType_;
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static automation.Automation.DeviceRole parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceRole parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceRole parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceRole parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceRole parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceRole parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceRole parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static automation.Automation.DeviceRole parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static automation.Automation.DeviceRole parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static automation.Automation.DeviceRole parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static automation.Automation.DeviceRole parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static automation.Automation.DeviceRole parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(automation.Automation.DeviceRole prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code automation.DeviceRole}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:automation.DeviceRole)
automation.Automation.DeviceRoleOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return automation.Automation.internal_static_automation_DeviceRole_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return automation.Automation.internal_static_automation_DeviceRole_fieldAccessorTable
.ensureFieldAccessorsInitialized(
automation.Automation.DeviceRole.class, automation.Automation.DeviceRole.Builder.class);
}
// Construct using automation.Automation.DeviceRole.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (devRoleIdBuilder_ == null) {
devRoleId_ = null;
} else {
devRoleId_ = null;
devRoleIdBuilder_ = null;
}
devRoleType_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return automation.Automation.internal_static_automation_DeviceRole_descriptor;
}
@java.lang.Override
public automation.Automation.DeviceRole getDefaultInstanceForType() {
return automation.Automation.DeviceRole.getDefaultInstance();
}
@java.lang.Override
public automation.Automation.DeviceRole build() {
automation.Automation.DeviceRole result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public automation.Automation.DeviceRole buildPartial() {
automation.Automation.DeviceRole result = new automation.Automation.DeviceRole(this);
if (devRoleIdBuilder_ == null) {
result.devRoleId_ = devRoleId_;
} else {
result.devRoleId_ = devRoleIdBuilder_.build();
}
result.devRoleType_ = devRoleType_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof automation.Automation.DeviceRole) {
return mergeFrom((automation.Automation.DeviceRole)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(automation.Automation.DeviceRole other) {
if (other == automation.Automation.DeviceRole.getDefaultInstance()) return this;
if (other.hasDevRoleId()) {
mergeDevRoleId(other.getDevRoleId());
}
if (other.devRoleType_ != 0) {
setDevRoleTypeValue(other.getDevRoleTypeValue());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
automation.Automation.DeviceRole parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (automation.Automation.DeviceRole) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private automation.Automation.DeviceRoleId devRoleId_;
private com.google.protobuf.SingleFieldBuilderV3<
automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder> devRoleIdBuilder_;
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
* @return Whether the devRoleId field is set.
*/
public boolean hasDevRoleId() {
return devRoleIdBuilder_ != null || devRoleId_ != null;
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
* @return The devRoleId.
*/
public automation.Automation.DeviceRoleId getDevRoleId() {
if (devRoleIdBuilder_ == null) {
return devRoleId_ == null ? automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
} else {
return devRoleIdBuilder_.getMessage();
}
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
public Builder setDevRoleId(automation.Automation.DeviceRoleId value) {
if (devRoleIdBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
devRoleId_ = value;
onChanged();
} else {
devRoleIdBuilder_.setMessage(value);
}
return this;
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
public Builder setDevRoleId(
automation.Automation.DeviceRoleId.Builder builderForValue) {
if (devRoleIdBuilder_ == null) {
devRoleId_ = builderForValue.build();
onChanged();
} else {
devRoleIdBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
public Builder mergeDevRoleId(automation.Automation.DeviceRoleId value) {
if (devRoleIdBuilder_ == null) {
if (devRoleId_ != null) {
devRoleId_ =
automation.Automation.DeviceRoleId.newBuilder(devRoleId_).mergeFrom(value).buildPartial();
} else {
devRoleId_ = value;
}
onChanged();
} else {
devRoleIdBuilder_.mergeFrom(value);
}
return this;
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
public Builder clearDevRoleId() {
if (devRoleIdBuilder_ == null) {
devRoleId_ = null;
onChanged();
} else {
devRoleId_ = null;
devRoleIdBuilder_ = null;
}
return this;
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
public automation.Automation.DeviceRoleId.Builder getDevRoleIdBuilder() {
onChanged();
return getDevRoleIdFieldBuilder().getBuilder();
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
public automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() {
if (devRoleIdBuilder_ != null) {
return devRoleIdBuilder_.getMessageOrBuilder();
} else {
return devRoleId_ == null ?
automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
}
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder>
getDevRoleIdFieldBuilder() {
if (devRoleIdBuilder_ == null) {
devRoleIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder>(
getDevRoleId(),
getParentForChildren(),
isClean());
devRoleId_ = null;
}
return devRoleIdBuilder_;
}
private int devRoleType_ = 0;
/**
* <code>.automation.DeviceRoleType devRoleType = 2;</code>
* @return The enum numeric value on the wire for devRoleType.
*/
@java.lang.Override public int getDevRoleTypeValue() {
return devRoleType_;
}
/**
* <code>.automation.DeviceRoleType devRoleType = 2;</code>
* @param value The enum numeric value on the wire for devRoleType to set.
* @return This builder for chaining.
*/
public Builder setDevRoleTypeValue(int value) {
devRoleType_ = value;
onChanged();
return this;
}
/**
* <code>.automation.DeviceRoleType devRoleType = 2;</code>
* @return The devRoleType.
*/
@java.lang.Override
public automation.Automation.DeviceRoleType getDevRoleType() {
@SuppressWarnings("deprecation")
automation.Automation.DeviceRoleType result = automation.Automation.DeviceRoleType.valueOf(devRoleType_);
return result == null ? automation.Automation.DeviceRoleType.UNRECOGNIZED : result;
}
/**
* <code>.automation.DeviceRoleType devRoleType = 2;</code>
* @param value The devRoleType to set.
* @return This builder for chaining.
*/
public Builder setDevRoleType(automation.Automation.DeviceRoleType value) {
if (value == null) {
throw new NullPointerException();
}
devRoleType_ = value.getNumber();
onChanged();
return this;
}
/**
* <code>.automation.DeviceRoleType devRoleType = 2;</code>
* @return This builder for chaining.
*/
public Builder clearDevRoleType() {
devRoleType_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:automation.DeviceRole)
}
// @@protoc_insertion_point(class_scope:automation.DeviceRole)
private static final automation.Automation.DeviceRole DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new automation.Automation.DeviceRole();
}
public static automation.Automation.DeviceRole getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DeviceRole>
PARSER = new com.google.protobuf.AbstractParser<DeviceRole>() {
@java.lang.Override
public DeviceRole parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DeviceRole(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<DeviceRole> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<DeviceRole> getParserForType() {
return PARSER;
}
@java.lang.Override
public automation.Automation.DeviceRole getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface DeviceRoleConfigOrBuilder extends
// @@protoc_insertion_point(interface_extends:automation.DeviceRoleConfig)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.automation.DeviceRole devRole = 1;</code>
* @return Whether the devRole field is set.
*/
boolean hasDevRole();
/**
* <code>.automation.DeviceRole devRole = 1;</code>
* @return The devRole.
*/
automation.Automation.DeviceRole getDevRole();
/**
* <code>.automation.DeviceRole devRole = 1;</code>
*/
automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder();
/**
* <code>.context.DeviceConfig devConfig = 2;</code>
* @return Whether the devConfig field is set.
*/
boolean hasDevConfig();
/**
* <code>.context.DeviceConfig devConfig = 2;</code>
* @return The devConfig.
*/
context.ContextOuterClass.DeviceConfig getDevConfig();
/**
* <code>.context.DeviceConfig devConfig = 2;</code>
*/
context.ContextOuterClass.DeviceConfigOrBuilder getDevConfigOrBuilder();
}
/**
* Protobuf type {@code automation.DeviceRoleConfig}
*/
public static final class DeviceRoleConfig extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:automation.DeviceRoleConfig)
DeviceRoleConfigOrBuilder {
private static final long serialVersionUID = 0L;
// Use DeviceRoleConfig.newBuilder() to construct.
private DeviceRoleConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DeviceRoleConfig() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DeviceRoleConfig();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DeviceRoleConfig(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
automation.Automation.DeviceRole.Builder subBuilder = null;
if (devRole_ != null) {
subBuilder = devRole_.toBuilder();
}
devRole_ = input.readMessage(automation.Automation.DeviceRole.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(devRole_);
devRole_ = subBuilder.buildPartial();
}
break;
}
case 18: {
context.ContextOuterClass.DeviceConfig.Builder subBuilder = null;
if (devConfig_ != null) {
subBuilder = devConfig_.toBuilder();
}
devConfig_ = input.readMessage(context.ContextOuterClass.DeviceConfig.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(devConfig_);
devConfig_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return automation.Automation.internal_static_automation_DeviceRoleConfig_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return automation.Automation.internal_static_automation_DeviceRoleConfig_fieldAccessorTable
.ensureFieldAccessorsInitialized(
automation.Automation.DeviceRoleConfig.class, automation.Automation.DeviceRoleConfig.Builder.class);
}
public static final int DEVROLE_FIELD_NUMBER = 1;
private automation.Automation.DeviceRole devRole_;
/**
* <code>.automation.DeviceRole devRole = 1;</code>
* @return Whether the devRole field is set.
*/
@java.lang.Override
public boolean hasDevRole() {
return devRole_ != null;
}
/**
* <code>.automation.DeviceRole devRole = 1;</code>
* @return The devRole.
*/
@java.lang.Override
public automation.Automation.DeviceRole getDevRole() {
return devRole_ == null ? automation.Automation.DeviceRole.getDefaultInstance() : devRole_;
}
/**
* <code>.automation.DeviceRole devRole = 1;</code>
*/
@java.lang.Override
public automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder() {
return getDevRole();
}
public static final int DEVCONFIG_FIELD_NUMBER = 2;
private context.ContextOuterClass.DeviceConfig devConfig_;
/**
* <code>.context.DeviceConfig devConfig = 2;</code>
* @return Whether the devConfig field is set.
*/
@java.lang.Override
public boolean hasDevConfig() {
return devConfig_ != null;
}
/**
* <code>.context.DeviceConfig devConfig = 2;</code>
* @return The devConfig.
*/
@java.lang.Override
public context.ContextOuterClass.DeviceConfig getDevConfig() {
return devConfig_ == null ? context.ContextOuterClass.DeviceConfig.getDefaultInstance() : devConfig_;
}
/**
* <code>.context.DeviceConfig devConfig = 2;</code>
*/
@java.lang.Override
public context.ContextOuterClass.DeviceConfigOrBuilder getDevConfigOrBuilder() {
return getDevConfig();
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (devRole_ != null) {
output.writeMessage(1, getDevRole());
}
if (devConfig_ != null) {
output.writeMessage(2, getDevConfig());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (devRole_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getDevRole());
}
if (devConfig_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getDevConfig());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof automation.Automation.DeviceRoleConfig)) {
return super.equals(obj);
}
automation.Automation.DeviceRoleConfig other = (automation.Automation.DeviceRoleConfig) obj;
if (hasDevRole() != other.hasDevRole()) return false;
if (hasDevRole()) {
if (!getDevRole()
.equals(other.getDevRole())) return false;
}
if (hasDevConfig() != other.hasDevConfig()) return false;
if (hasDevConfig()) {
if (!getDevConfig()
.equals(other.getDevConfig())) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasDevRole()) {
hash = (37 * hash) + DEVROLE_FIELD_NUMBER;
hash = (53 * hash) + getDevRole().hashCode();
}
if (hasDevConfig()) {
hash = (37 * hash) + DEVCONFIG_FIELD_NUMBER;
hash = (53 * hash) + getDevConfig().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static automation.Automation.DeviceRoleConfig parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceRoleConfig parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceRoleConfig parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceRoleConfig parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceRoleConfig parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceRoleConfig parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceRoleConfig parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static automation.Automation.DeviceRoleConfig parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static automation.Automation.DeviceRoleConfig parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static automation.Automation.DeviceRoleConfig parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static automation.Automation.DeviceRoleConfig parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static automation.Automation.DeviceRoleConfig parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(automation.Automation.DeviceRoleConfig prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code automation.DeviceRoleConfig}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:automation.DeviceRoleConfig)
automation.Automation.DeviceRoleConfigOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return automation.Automation.internal_static_automation_DeviceRoleConfig_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return automation.Automation.internal_static_automation_DeviceRoleConfig_fieldAccessorTable
.ensureFieldAccessorsInitialized(
automation.Automation.DeviceRoleConfig.class, automation.Automation.DeviceRoleConfig.Builder.class);
}
// Construct using automation.Automation.DeviceRoleConfig.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (devRoleBuilder_ == null) {
devRole_ = null;
} else {
devRole_ = null;
devRoleBuilder_ = null;
}
if (devConfigBuilder_ == null) {
devConfig_ = null;
} else {
devConfig_ = null;
devConfigBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return automation.Automation.internal_static_automation_DeviceRoleConfig_descriptor;
}
@java.lang.Override
public automation.Automation.DeviceRoleConfig getDefaultInstanceForType() {
return automation.Automation.DeviceRoleConfig.getDefaultInstance();
}
@java.lang.Override
public automation.Automation.DeviceRoleConfig build() {
automation.Automation.DeviceRoleConfig result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public automation.Automation.DeviceRoleConfig buildPartial() {
automation.Automation.DeviceRoleConfig result = new automation.Automation.DeviceRoleConfig(this);
if (devRoleBuilder_ == null) {
result.devRole_ = devRole_;
} else {
result.devRole_ = devRoleBuilder_.build();
}
if (devConfigBuilder_ == null) {
result.devConfig_ = devConfig_;
} else {
result.devConfig_ = devConfigBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof automation.Automation.DeviceRoleConfig) {
return mergeFrom((automation.Automation.DeviceRoleConfig)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(automation.Automation.DeviceRoleConfig other) {
if (other == automation.Automation.DeviceRoleConfig.getDefaultInstance()) return this;
if (other.hasDevRole()) {
mergeDevRole(other.getDevRole());
}
if (other.hasDevConfig()) {
mergeDevConfig(other.getDevConfig());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
automation.Automation.DeviceRoleConfig parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (automation.Automation.DeviceRoleConfig) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private automation.Automation.DeviceRole devRole_;
private com.google.protobuf.SingleFieldBuilderV3<
automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder> devRoleBuilder_;
/**
* <code>.automation.DeviceRole devRole = 1;</code>
* @return Whether the devRole field is set.
*/
public boolean hasDevRole() {
return devRoleBuilder_ != null || devRole_ != null;
}
/**
* <code>.automation.DeviceRole devRole = 1;</code>
* @return The devRole.
*/
public automation.Automation.DeviceRole getDevRole() {
if (devRoleBuilder_ == null) {
return devRole_ == null ? automation.Automation.DeviceRole.getDefaultInstance() : devRole_;
} else {
return devRoleBuilder_.getMessage();
}
}
/**
* <code>.automation.DeviceRole devRole = 1;</code>
*/
public Builder setDevRole(automation.Automation.DeviceRole value) {
if (devRoleBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
devRole_ = value;
onChanged();
} else {
devRoleBuilder_.setMessage(value);
}
return this;
}
/**
* <code>.automation.DeviceRole devRole = 1;</code>
*/
public Builder setDevRole(
automation.Automation.DeviceRole.Builder builderForValue) {
if (devRoleBuilder_ == null) {
devRole_ = builderForValue.build();
onChanged();
} else {
devRoleBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <code>.automation.DeviceRole devRole = 1;</code>
*/
public Builder mergeDevRole(automation.Automation.DeviceRole value) {
if (devRoleBuilder_ == null) {
if (devRole_ != null) {
devRole_ =
automation.Automation.DeviceRole.newBuilder(devRole_).mergeFrom(value).buildPartial();
} else {
devRole_ = value;
}
onChanged();
} else {
devRoleBuilder_.mergeFrom(value);
}
return this;
}
/**
* <code>.automation.DeviceRole devRole = 1;</code>
*/
public Builder clearDevRole() {
if (devRoleBuilder_ == null) {
devRole_ = null;
onChanged();
} else {
devRole_ = null;
devRoleBuilder_ = null;
}
return this;
}
/**
* <code>.automation.DeviceRole devRole = 1;</code>
*/
public automation.Automation.DeviceRole.Builder getDevRoleBuilder() {
onChanged();
return getDevRoleFieldBuilder().getBuilder();
}
/**
* <code>.automation.DeviceRole devRole = 1;</code>
*/
public automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder() {
if (devRoleBuilder_ != null) {
return devRoleBuilder_.getMessageOrBuilder();
} else {
return devRole_ == null ?
automation.Automation.DeviceRole.getDefaultInstance() : devRole_;
}
}
/**
* <code>.automation.DeviceRole devRole = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder>
getDevRoleFieldBuilder() {
if (devRoleBuilder_ == null) {
devRoleBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder>(
getDevRole(),
getParentForChildren(),
isClean());
devRole_ = null;
}
return devRoleBuilder_;
}
private context.ContextOuterClass.DeviceConfig devConfig_;
private com.google.protobuf.SingleFieldBuilderV3<
context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder> devConfigBuilder_;
/**
* <code>.context.DeviceConfig devConfig = 2;</code>
* @return Whether the devConfig field is set.
*/
public boolean hasDevConfig() {
return devConfigBuilder_ != null || devConfig_ != null;
}
/**
* <code>.context.DeviceConfig devConfig = 2;</code>
* @return The devConfig.
*/
public context.ContextOuterClass.DeviceConfig getDevConfig() {
if (devConfigBuilder_ == null) {
return devConfig_ == null ? context.ContextOuterClass.DeviceConfig.getDefaultInstance() : devConfig_;
} else {
return devConfigBuilder_.getMessage();
}
}
/**
* <code>.context.DeviceConfig devConfig = 2;</code>
*/
public Builder setDevConfig(context.ContextOuterClass.DeviceConfig value) {
if (devConfigBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
devConfig_ = value;
onChanged();
} else {
devConfigBuilder_.setMessage(value);
}
return this;
}
/**
* <code>.context.DeviceConfig devConfig = 2;</code>
*/
public Builder setDevConfig(
context.ContextOuterClass.DeviceConfig.Builder builderForValue) {
if (devConfigBuilder_ == null) {
devConfig_ = builderForValue.build();
onChanged();
} else {
devConfigBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <code>.context.DeviceConfig devConfig = 2;</code>
*/
public Builder mergeDevConfig(context.ContextOuterClass.DeviceConfig value) {
if (devConfigBuilder_ == null) {
if (devConfig_ != null) {
devConfig_ =
context.ContextOuterClass.DeviceConfig.newBuilder(devConfig_).mergeFrom(value).buildPartial();
} else {
devConfig_ = value;
}
onChanged();
} else {
devConfigBuilder_.mergeFrom(value);
}
return this;
}
/**
* <code>.context.DeviceConfig devConfig = 2;</code>
*/
public Builder clearDevConfig() {
if (devConfigBuilder_ == null) {
devConfig_ = null;
onChanged();
} else {
devConfig_ = null;
devConfigBuilder_ = null;
}
return this;
}
/**
* <code>.context.DeviceConfig devConfig = 2;</code>
*/
public context.ContextOuterClass.DeviceConfig.Builder getDevConfigBuilder() {
onChanged();
return getDevConfigFieldBuilder().getBuilder();
}
/**
* <code>.context.DeviceConfig devConfig = 2;</code>
*/
public context.ContextOuterClass.DeviceConfigOrBuilder getDevConfigOrBuilder() {
if (devConfigBuilder_ != null) {
return devConfigBuilder_.getMessageOrBuilder();
} else {
return devConfig_ == null ?
context.ContextOuterClass.DeviceConfig.getDefaultInstance() : devConfig_;
}
}
/**
* <code>.context.DeviceConfig devConfig = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder>
getDevConfigFieldBuilder() {
if (devConfigBuilder_ == null) {
devConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
context.ContextOuterClass.DeviceConfig, context.ContextOuterClass.DeviceConfig.Builder, context.ContextOuterClass.DeviceConfigOrBuilder>(
getDevConfig(),
getParentForChildren(),
isClean());
devConfig_ = null;
}
return devConfigBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:automation.DeviceRoleConfig)
}
// @@protoc_insertion_point(class_scope:automation.DeviceRoleConfig)
private static final automation.Automation.DeviceRoleConfig DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new automation.Automation.DeviceRoleConfig();
}
public static automation.Automation.DeviceRoleConfig getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DeviceRoleConfig>
PARSER = new com.google.protobuf.AbstractParser<DeviceRoleConfig>() {
@java.lang.Override
public DeviceRoleConfig parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DeviceRoleConfig(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<DeviceRoleConfig> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<DeviceRoleConfig> getParserForType() {
return PARSER;
}
@java.lang.Override
public automation.Automation.DeviceRoleConfig getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface DeviceRoleListOrBuilder extends
// @@protoc_insertion_point(interface_extends:automation.DeviceRoleList)
com.google.protobuf.MessageOrBuilder {
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
java.util.List<automation.Automation.DeviceRole>
getDevRoleList();
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
automation.Automation.DeviceRole getDevRole(int index);
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
int getDevRoleCount();
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
java.util.List<? extends automation.Automation.DeviceRoleOrBuilder>
getDevRoleOrBuilderList();
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder(
int index);
}
/**
* Protobuf type {@code automation.DeviceRoleList}
*/
public static final class DeviceRoleList extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:automation.DeviceRoleList)
DeviceRoleListOrBuilder {
private static final long serialVersionUID = 0L;
// Use DeviceRoleList.newBuilder() to construct.
private DeviceRoleList(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DeviceRoleList() {
devRole_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DeviceRoleList();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DeviceRoleList(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
devRole_ = new java.util.ArrayList<automation.Automation.DeviceRole>();
mutable_bitField0_ |= 0x00000001;
}
devRole_.add(
input.readMessage(automation.Automation.DeviceRole.parser(), extensionRegistry));
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
devRole_ = java.util.Collections.unmodifiableList(devRole_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return automation.Automation.internal_static_automation_DeviceRoleList_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return automation.Automation.internal_static_automation_DeviceRoleList_fieldAccessorTable
.ensureFieldAccessorsInitialized(
automation.Automation.DeviceRoleList.class, automation.Automation.DeviceRoleList.Builder.class);
}
public static final int DEVROLE_FIELD_NUMBER = 1;
private java.util.List<automation.Automation.DeviceRole> devRole_;
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
@java.lang.Override
public java.util.List<automation.Automation.DeviceRole> getDevRoleList() {
return devRole_;
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
@java.lang.Override
public java.util.List<? extends automation.Automation.DeviceRoleOrBuilder>
getDevRoleOrBuilderList() {
return devRole_;
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
@java.lang.Override
public int getDevRoleCount() {
return devRole_.size();
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
@java.lang.Override
public automation.Automation.DeviceRole getDevRole(int index) {
return devRole_.get(index);
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
@java.lang.Override
public automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder(
int index) {
return devRole_.get(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
for (int i = 0; i < devRole_.size(); i++) {
output.writeMessage(1, devRole_.get(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < devRole_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, devRole_.get(i));
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof automation.Automation.DeviceRoleList)) {
return super.equals(obj);
}
automation.Automation.DeviceRoleList other = (automation.Automation.DeviceRoleList) obj;
if (!getDevRoleList()
.equals(other.getDevRoleList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getDevRoleCount() > 0) {
hash = (37 * hash) + DEVROLE_FIELD_NUMBER;
hash = (53 * hash) + getDevRoleList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static automation.Automation.DeviceRoleList parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceRoleList parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceRoleList parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceRoleList parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceRoleList parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceRoleList parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceRoleList parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static automation.Automation.DeviceRoleList parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static automation.Automation.DeviceRoleList parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static automation.Automation.DeviceRoleList parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static automation.Automation.DeviceRoleList parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static automation.Automation.DeviceRoleList parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(automation.Automation.DeviceRoleList prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code automation.DeviceRoleList}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:automation.DeviceRoleList)
automation.Automation.DeviceRoleListOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return automation.Automation.internal_static_automation_DeviceRoleList_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return automation.Automation.internal_static_automation_DeviceRoleList_fieldAccessorTable
.ensureFieldAccessorsInitialized(
automation.Automation.DeviceRoleList.class, automation.Automation.DeviceRoleList.Builder.class);
}
// Construct using automation.Automation.DeviceRoleList.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getDevRoleFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (devRoleBuilder_ == null) {
devRole_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
devRoleBuilder_.clear();
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return automation.Automation.internal_static_automation_DeviceRoleList_descriptor;
}
@java.lang.Override
public automation.Automation.DeviceRoleList getDefaultInstanceForType() {
return automation.Automation.DeviceRoleList.getDefaultInstance();
}
@java.lang.Override
public automation.Automation.DeviceRoleList build() {
automation.Automation.DeviceRoleList result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public automation.Automation.DeviceRoleList buildPartial() {
automation.Automation.DeviceRoleList result = new automation.Automation.DeviceRoleList(this);
int from_bitField0_ = bitField0_;
if (devRoleBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
devRole_ = java.util.Collections.unmodifiableList(devRole_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.devRole_ = devRole_;
} else {
result.devRole_ = devRoleBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof automation.Automation.DeviceRoleList) {
return mergeFrom((automation.Automation.DeviceRoleList)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(automation.Automation.DeviceRoleList other) {
if (other == automation.Automation.DeviceRoleList.getDefaultInstance()) return this;
if (devRoleBuilder_ == null) {
if (!other.devRole_.isEmpty()) {
if (devRole_.isEmpty()) {
devRole_ = other.devRole_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureDevRoleIsMutable();
devRole_.addAll(other.devRole_);
}
onChanged();
}
} else {
if (!other.devRole_.isEmpty()) {
if (devRoleBuilder_.isEmpty()) {
devRoleBuilder_.dispose();
devRoleBuilder_ = null;
devRole_ = other.devRole_;
bitField0_ = (bitField0_ & ~0x00000001);
devRoleBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getDevRoleFieldBuilder() : null;
} else {
devRoleBuilder_.addAllMessages(other.devRole_);
}
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
automation.Automation.DeviceRoleList parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (automation.Automation.DeviceRoleList) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.util.List<automation.Automation.DeviceRole> devRole_ =
java.util.Collections.emptyList();
private void ensureDevRoleIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
devRole_ = new java.util.ArrayList<automation.Automation.DeviceRole>(devRole_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder> devRoleBuilder_;
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public java.util.List<automation.Automation.DeviceRole> getDevRoleList() {
if (devRoleBuilder_ == null) {
return java.util.Collections.unmodifiableList(devRole_);
} else {
return devRoleBuilder_.getMessageList();
}
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public int getDevRoleCount() {
if (devRoleBuilder_ == null) {
return devRole_.size();
} else {
return devRoleBuilder_.getCount();
}
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public automation.Automation.DeviceRole getDevRole(int index) {
if (devRoleBuilder_ == null) {
return devRole_.get(index);
} else {
return devRoleBuilder_.getMessage(index);
}
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public Builder setDevRole(
int index, automation.Automation.DeviceRole value) {
if (devRoleBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureDevRoleIsMutable();
devRole_.set(index, value);
onChanged();
} else {
devRoleBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public Builder setDevRole(
int index, automation.Automation.DeviceRole.Builder builderForValue) {
if (devRoleBuilder_ == null) {
ensureDevRoleIsMutable();
devRole_.set(index, builderForValue.build());
onChanged();
} else {
devRoleBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public Builder addDevRole(automation.Automation.DeviceRole value) {
if (devRoleBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureDevRoleIsMutable();
devRole_.add(value);
onChanged();
} else {
devRoleBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public Builder addDevRole(
int index, automation.Automation.DeviceRole value) {
if (devRoleBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureDevRoleIsMutable();
devRole_.add(index, value);
onChanged();
} else {
devRoleBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public Builder addDevRole(
automation.Automation.DeviceRole.Builder builderForValue) {
if (devRoleBuilder_ == null) {
ensureDevRoleIsMutable();
devRole_.add(builderForValue.build());
onChanged();
} else {
devRoleBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public Builder addDevRole(
int index, automation.Automation.DeviceRole.Builder builderForValue) {
if (devRoleBuilder_ == null) {
ensureDevRoleIsMutable();
devRole_.add(index, builderForValue.build());
onChanged();
} else {
devRoleBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public Builder addAllDevRole(
java.lang.Iterable<? extends automation.Automation.DeviceRole> values) {
if (devRoleBuilder_ == null) {
ensureDevRoleIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, devRole_);
onChanged();
} else {
devRoleBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public Builder clearDevRole() {
if (devRoleBuilder_ == null) {
devRole_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
devRoleBuilder_.clear();
}
return this;
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public Builder removeDevRole(int index) {
if (devRoleBuilder_ == null) {
ensureDevRoleIsMutable();
devRole_.remove(index);
onChanged();
} else {
devRoleBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public automation.Automation.DeviceRole.Builder getDevRoleBuilder(
int index) {
return getDevRoleFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public automation.Automation.DeviceRoleOrBuilder getDevRoleOrBuilder(
int index) {
if (devRoleBuilder_ == null) {
return devRole_.get(index); } else {
return devRoleBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public java.util.List<? extends automation.Automation.DeviceRoleOrBuilder>
getDevRoleOrBuilderList() {
if (devRoleBuilder_ != null) {
return devRoleBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(devRole_);
}
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public automation.Automation.DeviceRole.Builder addDevRoleBuilder() {
return getDevRoleFieldBuilder().addBuilder(
automation.Automation.DeviceRole.getDefaultInstance());
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public automation.Automation.DeviceRole.Builder addDevRoleBuilder(
int index) {
return getDevRoleFieldBuilder().addBuilder(
index, automation.Automation.DeviceRole.getDefaultInstance());
}
/**
* <code>repeated .automation.DeviceRole devRole = 1;</code>
*/
public java.util.List<automation.Automation.DeviceRole.Builder>
getDevRoleBuilderList() {
return getDevRoleFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder>
getDevRoleFieldBuilder() {
if (devRoleBuilder_ == null) {
devRoleBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
automation.Automation.DeviceRole, automation.Automation.DeviceRole.Builder, automation.Automation.DeviceRoleOrBuilder>(
devRole_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
devRole_ = null;
}
return devRoleBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:automation.DeviceRoleList)
}
// @@protoc_insertion_point(class_scope:automation.DeviceRoleList)
private static final automation.Automation.DeviceRoleList DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new automation.Automation.DeviceRoleList();
}
public static automation.Automation.DeviceRoleList getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DeviceRoleList>
PARSER = new com.google.protobuf.AbstractParser<DeviceRoleList>() {
@java.lang.Override
public DeviceRoleList parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DeviceRoleList(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<DeviceRoleList> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<DeviceRoleList> getParserForType() {
return PARSER;
}
@java.lang.Override
public automation.Automation.DeviceRoleList getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface DeviceRoleStateOrBuilder extends
// @@protoc_insertion_point(interface_extends:automation.DeviceRoleState)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
* @return Whether the devRoleId field is set.
*/
boolean hasDevRoleId();
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
* @return The devRoleId.
*/
automation.Automation.DeviceRoleId getDevRoleId();
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder();
/**
* <code>.automation.ZtpDeviceState devRoleState = 2;</code>
* @return The enum numeric value on the wire for devRoleState.
*/
int getDevRoleStateValue();
/**
* <code>.automation.ZtpDeviceState devRoleState = 2;</code>
* @return The devRoleState.
*/
automation.Automation.ZtpDeviceState getDevRoleState();
}
/**
* Protobuf type {@code automation.DeviceRoleState}
*/
public static final class DeviceRoleState extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:automation.DeviceRoleState)
DeviceRoleStateOrBuilder {
private static final long serialVersionUID = 0L;
// Use DeviceRoleState.newBuilder() to construct.
private DeviceRoleState(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DeviceRoleState() {
devRoleState_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DeviceRoleState();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DeviceRoleState(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
automation.Automation.DeviceRoleId.Builder subBuilder = null;
if (devRoleId_ != null) {
subBuilder = devRoleId_.toBuilder();
}
devRoleId_ = input.readMessage(automation.Automation.DeviceRoleId.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(devRoleId_);
devRoleId_ = subBuilder.buildPartial();
}
break;
}
case 16: {
int rawValue = input.readEnum();
devRoleState_ = rawValue;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return automation.Automation.internal_static_automation_DeviceRoleState_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return automation.Automation.internal_static_automation_DeviceRoleState_fieldAccessorTable
.ensureFieldAccessorsInitialized(
automation.Automation.DeviceRoleState.class, automation.Automation.DeviceRoleState.Builder.class);
}
public static final int DEVROLEID_FIELD_NUMBER = 1;
private automation.Automation.DeviceRoleId devRoleId_;
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
* @return Whether the devRoleId field is set.
*/
@java.lang.Override
public boolean hasDevRoleId() {
return devRoleId_ != null;
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
* @return The devRoleId.
*/
@java.lang.Override
public automation.Automation.DeviceRoleId getDevRoleId() {
return devRoleId_ == null ? automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
@java.lang.Override
public automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() {
return getDevRoleId();
}
public static final int DEVROLESTATE_FIELD_NUMBER = 2;
private int devRoleState_;
/**
* <code>.automation.ZtpDeviceState devRoleState = 2;</code>
* @return The enum numeric value on the wire for devRoleState.
*/
@java.lang.Override public int getDevRoleStateValue() {
return devRoleState_;
}
/**
* <code>.automation.ZtpDeviceState devRoleState = 2;</code>
* @return The devRoleState.
*/
@java.lang.Override public automation.Automation.ZtpDeviceState getDevRoleState() {
@SuppressWarnings("deprecation")
automation.Automation.ZtpDeviceState result = automation.Automation.ZtpDeviceState.valueOf(devRoleState_);
return result == null ? automation.Automation.ZtpDeviceState.UNRECOGNIZED : result;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (devRoleId_ != null) {
output.writeMessage(1, getDevRoleId());
}
if (devRoleState_ != automation.Automation.ZtpDeviceState.ZTP_DEV_STATE_UNDEFINED.getNumber()) {
output.writeEnum(2, devRoleState_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (devRoleId_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getDevRoleId());
}
if (devRoleState_ != automation.Automation.ZtpDeviceState.ZTP_DEV_STATE_UNDEFINED.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, devRoleState_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof automation.Automation.DeviceRoleState)) {
return super.equals(obj);
}
automation.Automation.DeviceRoleState other = (automation.Automation.DeviceRoleState) obj;
if (hasDevRoleId() != other.hasDevRoleId()) return false;
if (hasDevRoleId()) {
if (!getDevRoleId()
.equals(other.getDevRoleId())) return false;
}
if (devRoleState_ != other.devRoleState_) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasDevRoleId()) {
hash = (37 * hash) + DEVROLEID_FIELD_NUMBER;
hash = (53 * hash) + getDevRoleId().hashCode();
}
hash = (37 * hash) + DEVROLESTATE_FIELD_NUMBER;
hash = (53 * hash) + devRoleState_;
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static automation.Automation.DeviceRoleState parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceRoleState parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceRoleState parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceRoleState parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceRoleState parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceRoleState parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceRoleState parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static automation.Automation.DeviceRoleState parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static automation.Automation.DeviceRoleState parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static automation.Automation.DeviceRoleState parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static automation.Automation.DeviceRoleState parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static automation.Automation.DeviceRoleState parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(automation.Automation.DeviceRoleState prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code automation.DeviceRoleState}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:automation.DeviceRoleState)
automation.Automation.DeviceRoleStateOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return automation.Automation.internal_static_automation_DeviceRoleState_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return automation.Automation.internal_static_automation_DeviceRoleState_fieldAccessorTable
.ensureFieldAccessorsInitialized(
automation.Automation.DeviceRoleState.class, automation.Automation.DeviceRoleState.Builder.class);
}
// Construct using automation.Automation.DeviceRoleState.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (devRoleIdBuilder_ == null) {
devRoleId_ = null;
} else {
devRoleId_ = null;
devRoleIdBuilder_ = null;
}
devRoleState_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return automation.Automation.internal_static_automation_DeviceRoleState_descriptor;
}
@java.lang.Override
public automation.Automation.DeviceRoleState getDefaultInstanceForType() {
return automation.Automation.DeviceRoleState.getDefaultInstance();
}
@java.lang.Override
public automation.Automation.DeviceRoleState build() {
automation.Automation.DeviceRoleState result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public automation.Automation.DeviceRoleState buildPartial() {
automation.Automation.DeviceRoleState result = new automation.Automation.DeviceRoleState(this);
if (devRoleIdBuilder_ == null) {
result.devRoleId_ = devRoleId_;
} else {
result.devRoleId_ = devRoleIdBuilder_.build();
}
result.devRoleState_ = devRoleState_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof automation.Automation.DeviceRoleState) {
return mergeFrom((automation.Automation.DeviceRoleState)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(automation.Automation.DeviceRoleState other) {
if (other == automation.Automation.DeviceRoleState.getDefaultInstance()) return this;
if (other.hasDevRoleId()) {
mergeDevRoleId(other.getDevRoleId());
}
if (other.devRoleState_ != 0) {
setDevRoleStateValue(other.getDevRoleStateValue());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
automation.Automation.DeviceRoleState parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (automation.Automation.DeviceRoleState) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private automation.Automation.DeviceRoleId devRoleId_;
private com.google.protobuf.SingleFieldBuilderV3<
automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder> devRoleIdBuilder_;
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
* @return Whether the devRoleId field is set.
*/
public boolean hasDevRoleId() {
return devRoleIdBuilder_ != null || devRoleId_ != null;
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
* @return The devRoleId.
*/
public automation.Automation.DeviceRoleId getDevRoleId() {
if (devRoleIdBuilder_ == null) {
return devRoleId_ == null ? automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
} else {
return devRoleIdBuilder_.getMessage();
}
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
public Builder setDevRoleId(automation.Automation.DeviceRoleId value) {
if (devRoleIdBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
devRoleId_ = value;
onChanged();
} else {
devRoleIdBuilder_.setMessage(value);
}
return this;
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
public Builder setDevRoleId(
automation.Automation.DeviceRoleId.Builder builderForValue) {
if (devRoleIdBuilder_ == null) {
devRoleId_ = builderForValue.build();
onChanged();
} else {
devRoleIdBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
public Builder mergeDevRoleId(automation.Automation.DeviceRoleId value) {
if (devRoleIdBuilder_ == null) {
if (devRoleId_ != null) {
devRoleId_ =
automation.Automation.DeviceRoleId.newBuilder(devRoleId_).mergeFrom(value).buildPartial();
} else {
devRoleId_ = value;
}
onChanged();
} else {
devRoleIdBuilder_.mergeFrom(value);
}
return this;
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
public Builder clearDevRoleId() {
if (devRoleIdBuilder_ == null) {
devRoleId_ = null;
onChanged();
} else {
devRoleId_ = null;
devRoleIdBuilder_ = null;
}
return this;
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
public automation.Automation.DeviceRoleId.Builder getDevRoleIdBuilder() {
onChanged();
return getDevRoleIdFieldBuilder().getBuilder();
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
public automation.Automation.DeviceRoleIdOrBuilder getDevRoleIdOrBuilder() {
if (devRoleIdBuilder_ != null) {
return devRoleIdBuilder_.getMessageOrBuilder();
} else {
return devRoleId_ == null ?
automation.Automation.DeviceRoleId.getDefaultInstance() : devRoleId_;
}
}
/**
* <code>.automation.DeviceRoleId devRoleId = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder>
getDevRoleIdFieldBuilder() {
if (devRoleIdBuilder_ == null) {
devRoleIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
automation.Automation.DeviceRoleId, automation.Automation.DeviceRoleId.Builder, automation.Automation.DeviceRoleIdOrBuilder>(
getDevRoleId(),
getParentForChildren(),
isClean());
devRoleId_ = null;
}
return devRoleIdBuilder_;
}
private int devRoleState_ = 0;
/**
* <code>.automation.ZtpDeviceState devRoleState = 2;</code>
* @return The enum numeric value on the wire for devRoleState.
*/
@java.lang.Override public int getDevRoleStateValue() {
return devRoleState_;
}
/**
* <code>.automation.ZtpDeviceState devRoleState = 2;</code>
* @param value The enum numeric value on the wire for devRoleState to set.
* @return This builder for chaining.
*/
public Builder setDevRoleStateValue(int value) {
devRoleState_ = value;
onChanged();
return this;
}
/**
* <code>.automation.ZtpDeviceState devRoleState = 2;</code>
* @return The devRoleState.
*/
@java.lang.Override
public automation.Automation.ZtpDeviceState getDevRoleState() {
@SuppressWarnings("deprecation")
automation.Automation.ZtpDeviceState result = automation.Automation.ZtpDeviceState.valueOf(devRoleState_);
return result == null ? automation.Automation.ZtpDeviceState.UNRECOGNIZED : result;
}
/**
* <code>.automation.ZtpDeviceState devRoleState = 2;</code>
* @param value The devRoleState to set.
* @return This builder for chaining.
*/
public Builder setDevRoleState(automation.Automation.ZtpDeviceState value) {
if (value == null) {
throw new NullPointerException();
}
devRoleState_ = value.getNumber();
onChanged();
return this;
}
/**
* <code>.automation.ZtpDeviceState devRoleState = 2;</code>
* @return This builder for chaining.
*/
public Builder clearDevRoleState() {
devRoleState_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:automation.DeviceRoleState)
}
// @@protoc_insertion_point(class_scope:automation.DeviceRoleState)
private static final automation.Automation.DeviceRoleState DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new automation.Automation.DeviceRoleState();
}
public static automation.Automation.DeviceRoleState getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DeviceRoleState>
PARSER = new com.google.protobuf.AbstractParser<DeviceRoleState>() {
@java.lang.Override
public DeviceRoleState parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DeviceRoleState(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<DeviceRoleState> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<DeviceRoleState> getParserForType() {
return PARSER;
}
@java.lang.Override
public automation.Automation.DeviceRoleState getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface DeviceDeletionResultOrBuilder extends
// @@protoc_insertion_point(interface_extends:automation.DeviceDeletionResult)
com.google.protobuf.MessageOrBuilder {
/**
* <code>repeated string deleted = 1;</code>
* @return A list containing the deleted.
*/
java.util.List<java.lang.String>
getDeletedList();
/**
* <code>repeated string deleted = 1;</code>
* @return The count of deleted.
*/
int getDeletedCount();
/**
* <code>repeated string deleted = 1;</code>
* @param index The index of the element to return.
* @return The deleted at the given index.
*/
java.lang.String getDeleted(int index);
/**
* <code>repeated string deleted = 1;</code>
* @param index The index of the value to return.
* @return The bytes of the deleted at the given index.
*/
com.google.protobuf.ByteString
getDeletedBytes(int index);
}
/**
* Protobuf type {@code automation.DeviceDeletionResult}
*/
public static final class DeviceDeletionResult extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:automation.DeviceDeletionResult)
DeviceDeletionResultOrBuilder {
private static final long serialVersionUID = 0L;
// Use DeviceDeletionResult.newBuilder() to construct.
private DeviceDeletionResult(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DeviceDeletionResult() {
deleted_ = com.google.protobuf.LazyStringArrayList.EMPTY;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DeviceDeletionResult();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DeviceDeletionResult(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
deleted_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000001;
}
deleted_.add(s);
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
deleted_ = deleted_.getUnmodifiableView();
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return automation.Automation.internal_static_automation_DeviceDeletionResult_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return automation.Automation.internal_static_automation_DeviceDeletionResult_fieldAccessorTable
.ensureFieldAccessorsInitialized(
automation.Automation.DeviceDeletionResult.class, automation.Automation.DeviceDeletionResult.Builder.class);
}
public static final int DELETED_FIELD_NUMBER = 1;
private com.google.protobuf.LazyStringList deleted_;
/**
* <code>repeated string deleted = 1;</code>
* @return A list containing the deleted.
*/
public com.google.protobuf.ProtocolStringList
getDeletedList() {
return deleted_;
}
/**
* <code>repeated string deleted = 1;</code>
* @return The count of deleted.
*/
public int getDeletedCount() {
return deleted_.size();
}
/**
* <code>repeated string deleted = 1;</code>
* @param index The index of the element to return.
* @return The deleted at the given index.
*/
public java.lang.String getDeleted(int index) {
return deleted_.get(index);
}
/**
* <code>repeated string deleted = 1;</code>
* @param index The index of the value to return.
* @return The bytes of the deleted at the given index.
*/
public com.google.protobuf.ByteString
getDeletedBytes(int index) {
return deleted_.getByteString(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
for (int i = 0; i < deleted_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, deleted_.getRaw(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
for (int i = 0; i < deleted_.size(); i++) {
dataSize += computeStringSizeNoTag(deleted_.getRaw(i));
}
size += dataSize;
size += 1 * getDeletedList().size();
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof automation.Automation.DeviceDeletionResult)) {
return super.equals(obj);
}
automation.Automation.DeviceDeletionResult other = (automation.Automation.DeviceDeletionResult) obj;
if (!getDeletedList()
.equals(other.getDeletedList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getDeletedCount() > 0) {
hash = (37 * hash) + DELETED_FIELD_NUMBER;
hash = (53 * hash) + getDeletedList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static automation.Automation.DeviceDeletionResult parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceDeletionResult parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceDeletionResult parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceDeletionResult parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceDeletionResult parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static automation.Automation.DeviceDeletionResult parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static automation.Automation.DeviceDeletionResult parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static automation.Automation.DeviceDeletionResult parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static automation.Automation.DeviceDeletionResult parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static automation.Automation.DeviceDeletionResult parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static automation.Automation.DeviceDeletionResult parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static automation.Automation.DeviceDeletionResult parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(automation.Automation.DeviceDeletionResult prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* Protobuf type {@code automation.DeviceDeletionResult}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:automation.DeviceDeletionResult)
automation.Automation.DeviceDeletionResultOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return automation.Automation.internal_static_automation_DeviceDeletionResult_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return automation.Automation.internal_static_automation_DeviceDeletionResult_fieldAccessorTable
.ensureFieldAccessorsInitialized(
automation.Automation.DeviceDeletionResult.class, automation.Automation.DeviceDeletionResult.Builder.class);
}
// Construct using automation.Automation.DeviceDeletionResult.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
deleted_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return automation.Automation.internal_static_automation_DeviceDeletionResult_descriptor;
}
@java.lang.Override
public automation.Automation.DeviceDeletionResult getDefaultInstanceForType() {
return automation.Automation.DeviceDeletionResult.getDefaultInstance();
}
@java.lang.Override
public automation.Automation.DeviceDeletionResult build() {
automation.Automation.DeviceDeletionResult result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public automation.Automation.DeviceDeletionResult buildPartial() {
automation.Automation.DeviceDeletionResult result = new automation.Automation.DeviceDeletionResult(this);
int from_bitField0_ = bitField0_;
if (((bitField0_ & 0x00000001) != 0)) {
deleted_ = deleted_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000001);
}
result.deleted_ = deleted_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof automation.Automation.DeviceDeletionResult) {
return mergeFrom((automation.Automation.DeviceDeletionResult)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(automation.Automation.DeviceDeletionResult other) {
if (other == automation.Automation.DeviceDeletionResult.getDefaultInstance()) return this;
if (!other.deleted_.isEmpty()) {
if (deleted_.isEmpty()) {
deleted_ = other.deleted_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureDeletedIsMutable();
deleted_.addAll(other.deleted_);
}
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
automation.Automation.DeviceDeletionResult parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (automation.Automation.DeviceDeletionResult) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private com.google.protobuf.LazyStringList deleted_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureDeletedIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
deleted_ = new com.google.protobuf.LazyStringArrayList(deleted_);
bitField0_ |= 0x00000001;
}
}
/**
* <code>repeated string deleted = 1;</code>
* @return A list containing the deleted.
*/
public com.google.protobuf.ProtocolStringList
getDeletedList() {
return deleted_.getUnmodifiableView();
}
/**
* <code>repeated string deleted = 1;</code>
* @return The count of deleted.
*/
public int getDeletedCount() {
return deleted_.size();
}
/**
* <code>repeated string deleted = 1;</code>
* @param index The index of the element to return.
* @return The deleted at the given index.
*/
public java.lang.String getDeleted(int index) {
return deleted_.get(index);
}
/**
* <code>repeated string deleted = 1;</code>
* @param index The index of the value to return.
* @return The bytes of the deleted at the given index.
*/
public com.google.protobuf.ByteString
getDeletedBytes(int index) {
return deleted_.getByteString(index);
}
/**
* <code>repeated string deleted = 1;</code>
* @param index The index to set the value at.
* @param value The deleted to set.
* @return This builder for chaining.
*/
public Builder setDeleted(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureDeletedIsMutable();
deleted_.set(index, value);
onChanged();
return this;
}
/**
* <code>repeated string deleted = 1;</code>
* @param value The deleted to add.
* @return This builder for chaining.
*/
public Builder addDeleted(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureDeletedIsMutable();
deleted_.add(value);
onChanged();
return this;
}
/**
* <code>repeated string deleted = 1;</code>
* @param values The deleted to add.
* @return This builder for chaining.
*/
public Builder addAllDeleted(
java.lang.Iterable<java.lang.String> values) {
ensureDeletedIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, deleted_);
onChanged();
return this;
}
/**
* <code>repeated string deleted = 1;</code>
* @return This builder for chaining.
*/
public Builder clearDeleted() {
deleted_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
* <code>repeated string deleted = 1;</code>
* @param value The bytes of the deleted to add.
* @return This builder for chaining.
*/
public Builder addDeletedBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureDeletedIsMutable();
deleted_.add(value);
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:automation.DeviceDeletionResult)
}
// @@protoc_insertion_point(class_scope:automation.DeviceDeletionResult)
private static final automation.Automation.DeviceDeletionResult DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new automation.Automation.DeviceDeletionResult();
}
public static automation.Automation.DeviceDeletionResult getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DeviceDeletionResult>
PARSER = new com.google.protobuf.AbstractParser<DeviceDeletionResult>() {
@java.lang.Override
public DeviceDeletionResult parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DeviceDeletionResult(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<DeviceDeletionResult> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<DeviceDeletionResult> getParserForType() {
return PARSER;
}
@java.lang.Override
public automation.Automation.DeviceDeletionResult getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_automation_DeviceRoleId_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_automation_DeviceRoleId_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_automation_DeviceRole_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_automation_DeviceRole_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_automation_DeviceRoleConfig_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_automation_DeviceRoleConfig_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_automation_DeviceRoleList_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_automation_DeviceRoleList_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_automation_DeviceRoleState_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_automation_DeviceRoleState_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_automation_DeviceDeletionResult_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_automation_DeviceDeletionResult_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\020automation.proto\022\nautomation\032\rcontext." +
"proto\"R\n\014DeviceRoleId\022 \n\tdevRoleId\030\001 \001(\013" +
"2\r.context.Uuid\022 \n\005devId\030\002 \001(\0132\021.context" +
".DeviceId\"j\n\nDeviceRole\022+\n\tdevRoleId\030\001 \001" +
"(\0132\030.automation.DeviceRoleId\022/\n\013devRoleT" +
"ype\030\002 \001(\0162\032.automation.DeviceRoleType\"e\n" +
"\020DeviceRoleConfig\022\'\n\007devRole\030\001 \001(\0132\026.aut" +
"omation.DeviceRole\022(\n\tdevConfig\030\002 \001(\0132\025." +
"context.DeviceConfig\"9\n\016DeviceRoleList\022\'" +
"\n\007devRole\030\001 \003(\0132\026.automation.DeviceRole\"" +
"p\n\017DeviceRoleState\022+\n\tdevRoleId\030\001 \001(\0132\030." +
"automation.DeviceRoleId\0220\n\014devRoleState\030" +
"\002 \001(\0162\032.automation.ZtpDeviceState\"\'\n\024Dev" +
"iceDeletionResult\022\017\n\007deleted\030\001 \003(\t*H\n\016De" +
"viceRoleType\022\010\n\004NONE\020\000\022\013\n\007DEV_OPS\020\001\022\014\n\010D" +
"EV_CONF\020\002\022\021\n\rPIPELINE_CONF\020\003*~\n\016ZtpDevic" +
"eState\022\033\n\027ZTP_DEV_STATE_UNDEFINED\020\000\022\031\n\025Z" +
"TP_DEV_STATE_CREATED\020\001\022\031\n\025ZTP_DEV_STATE_" +
"UPDATED\020\002\022\031\n\025ZTP_DEV_STATE_DELETED\020\0032\276\003\n" +
"\021AutomationService\022F\n\020ZtpGetDeviceRole\022\030" +
".automation.DeviceRoleId\032\026.automation.De" +
"viceRole\"\000\022N\n\033ZtpGetDeviceRolesByDeviceI" +
"d\022\021.context.DeviceId\032\032.automation.Device" +
"RoleList\"\000\022?\n\006ZtpAdd\022\026.automation.Device" +
"Role\032\033.automation.DeviceRoleState\"\000\022H\n\tZ" +
"tpUpdate\022\034.automation.DeviceRoleConfig\032\033" +
".automation.DeviceRoleState\"\000\022B\n\tZtpDele" +
"te\022\026.automation.DeviceRole\032\033.automation." +
"DeviceRoleState\"\000\022B\n\014ZtpDeleteAll\022\016.cont" +
"ext.Empty\032 .automation.DeviceDeletionRes" +
"ult\"\000b\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
context.ContextOuterClass.getDescriptor(),
});
internal_static_automation_DeviceRoleId_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_automation_DeviceRoleId_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_automation_DeviceRoleId_descriptor,
new java.lang.String[] { "DevRoleId", "DevId", });
internal_static_automation_DeviceRole_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_automation_DeviceRole_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_automation_DeviceRole_descriptor,
new java.lang.String[] { "DevRoleId", "DevRoleType", });
internal_static_automation_DeviceRoleConfig_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_automation_DeviceRoleConfig_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_automation_DeviceRoleConfig_descriptor,
new java.lang.String[] { "DevRole", "DevConfig", });
internal_static_automation_DeviceRoleList_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_automation_DeviceRoleList_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_automation_DeviceRoleList_descriptor,
new java.lang.String[] { "DevRole", });
internal_static_automation_DeviceRoleState_descriptor =
getDescriptor().getMessageTypes().get(4);
internal_static_automation_DeviceRoleState_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_automation_DeviceRoleState_descriptor,
new java.lang.String[] { "DevRoleId", "DevRoleState", });
internal_static_automation_DeviceDeletionResult_descriptor =
getDescriptor().getMessageTypes().get(5);
internal_static_automation_DeviceDeletionResult_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_automation_DeviceDeletionResult_descriptor,
new java.lang.String[] { "Deleted", });
context.ContextOuterClass.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}