diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-09-08 17:48:53 +0200 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-09-17 09:30:51 +0200 |
commit | aaf2651b94c2f15b3c47e482fe519a6b56e31256 (patch) | |
tree | da32dad5520c94f981b802d40f3ae8e990421bad | |
parent | bac72033230c2ea0d1a99434376ae04ca05cf00e (diff) | |
download | sonarqube-aaf2651b94c2f15b3c47e482fe519a6b56e31256.tar.gz sonarqube-aaf2651b94c2f15b3c47e482fe519a6b56e31256.zip |
SONAR-6821 WS qualityprofiles/search use protocol buffers to build response
6 files changed, 2662 insertions, 99 deletions
diff --git a/microbenchmark-template/pom.xml b/microbenchmark-template/pom.xml index 3a23a5b48a4..9aeaa598e29 100644 --- a/microbenchmark-template/pom.xml +++ b/microbenchmark-template/pom.xml @@ -28,7 +28,7 @@ </dependency> <dependency> <groupId>${project.groupId}</groupId> - <artifactId>sonar-db</artifactId> + <artifactId>sonar-dbClient</artifactId> <version>${project.version}</version> </dependency> <dependency> diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileLoader.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileLoader.java index d4d49177118..a42f737b0a1 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileLoader.java +++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileLoader.java @@ -46,12 +46,12 @@ import org.sonar.server.user.UserSession; @ServerSide public class QProfileLoader { - private final DbClient db; + private final DbClient dbClient; private final IndexClient index; private final UserSession userSession; - public QProfileLoader(DbClient db, IndexClient index, UserSession userSession) { - this.db = db; + public QProfileLoader(DbClient dbClient, IndexClient index, UserSession userSession) { + this.dbClient = dbClient; this.index = index; this.userSession = userSession; } @@ -61,9 +61,9 @@ public class QProfileLoader { * profiles are not indexed and declared as a business object */ public List<QualityProfileDto> findAll() { - DbSession dbSession = db.openSession(false); + DbSession dbSession = dbClient.openSession(false); try { - return db.qualityProfileDao().selectAll(dbSession); + return dbClient.qualityProfileDao().selectAll(dbSession); } finally { dbSession.close(); } @@ -71,9 +71,9 @@ public class QProfileLoader { @CheckForNull public QualityProfileDto getByKey(String key) { - DbSession dbSession = db.openSession(false); + DbSession dbSession = dbClient.openSession(false); try { - return db.qualityProfileDao().selectByKey(dbSession, key); + return dbClient.qualityProfileDao().selectByKey(dbSession, key); } finally { dbSession.close(); } @@ -81,9 +81,9 @@ public class QProfileLoader { @CheckForNull public QualityProfileDto getByLangAndName(String lang, String name) { - DbSession dbSession = db.openSession(false); + DbSession dbSession = dbClient.openSession(false); try { - return db.qualityProfileDao().selectByNameAndLanguage(name, lang, dbSession); + return dbClient.qualityProfileDao().selectByNameAndLanguage(name, lang, dbSession); } finally { dbSession.close(); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java index e6dead6ed07..e754e15a31c 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java @@ -21,6 +21,13 @@ package org.sonar.server.qualityprofile.ws; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Maps; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.annotation.CheckForNull; +import javax.annotation.Nullable; import org.apache.commons.lang.builder.CompareToBuilder; import org.sonar.api.resources.Languages; import org.sonar.api.server.ws.Request; @@ -28,21 +35,15 @@ import org.sonar.api.server.ws.Response; import org.sonar.api.server.ws.WebService; import org.sonar.api.server.ws.WebService.NewAction; import org.sonar.api.server.ws.WebService.Param; -import org.sonar.api.utils.text.JsonWriter; -import org.sonar.db.qualityprofile.QualityProfileDao; import org.sonar.core.util.NonNullInputFunction; +import org.sonar.db.qualityprofile.QualityProfileDao; import org.sonar.server.qualityprofile.QProfile; import org.sonar.server.qualityprofile.QProfileLoader; import org.sonar.server.qualityprofile.QProfileLookup; +import org.sonarqube.ws.QualityProfiles.WsSearchResponse; +import org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile; -import javax.annotation.CheckForNull; -import javax.annotation.Nullable; - -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.Set; +import static org.sonar.server.ws.WsUtils.writeProtobuf; public class SearchAction implements QProfileWsAction { @@ -56,12 +57,16 @@ public class SearchAction implements QProfileWsAction { private static final String FIELD_PARENT_NAME = "parentName"; private static final String FIELD_ACTIVE_RULE_COUNT = "activeRuleCount"; private static final String FIELD_PROJECT_COUNT = "projectCount"; + private static final String FIELD_RULES_UPDATED_AT = "rulesUpdatedAt"; private static final Set<String> ALL_FIELDS = ImmutableSet.of( FIELD_KEY, FIELD_NAME, FIELD_LANGUAGE, FIELD_LANGUAGE_NAME, FIELD_IS_INHERITED, FIELD_PARENT_KEY, FIELD_PARENT_NAME, FIELD_IS_DEFAULT, FIELD_ACTIVE_RULE_COUNT, - FIELD_PROJECT_COUNT); + FIELD_PROJECT_COUNT, FIELD_RULES_UPDATED_AT); private static final String PARAM_LANGUAGE = FIELD_LANGUAGE; + private static final String PARAM_COMPONENT_KEY = "componentKey"; + private static final String PARAM_DEFAULT = "default"; + private static final String PARAM_PROFILE_NAME = "profileName"; private final Languages languages; private final QProfileLookup profileLookup; @@ -77,16 +82,28 @@ public class SearchAction implements QProfileWsAction { @Override public void define(WebService.NewController controller) { - NewAction search = controller.createAction("search") + NewAction action = controller.createAction("search") .setSince("5.2") .setDescription("List quality profiles.") .setHandler(this) .addFieldsParam(ALL_FIELDS) .setResponseExample(getClass().getResource("example-search.json")); - search.createParam(PARAM_LANGUAGE) + action.createParam(PARAM_LANGUAGE) .setDescription("The key of a language supported by the platform. If specified, only profiles for the given language are returned.") .setPossibleValues(LanguageParamUtils.getLanguageKeys(languages)); + + action.createParam(PARAM_COMPONENT_KEY) + .setDescription("Project or module key") + .setExampleValue("org.codehaus.sonar:sonar"); + + action.createParam(PARAM_DEFAULT) + .setDescription("Return default quality profiles") + .setBooleanPossibleValues(); + + action.createParam(PARAM_PROFILE_NAME) + .setDescription("Profile name") + .setExampleValue("SonarQube Way"); } @Override @@ -95,7 +112,7 @@ public class SearchAction implements QProfileWsAction { String language = request.param(PARAM_LANGUAGE); - List<QProfile> profiles = null; + List<QProfile> profiles; if (language == null) { profiles = profileLookup.allProfiles(); } else { @@ -111,13 +128,12 @@ public class SearchAction implements QProfileWsAction { .toComparison(); } }); + WsSearchResponse protobufResponse = buildResponse(profiles, fields); - JsonWriter json = response.newJsonWriter().beginObject(); - writeProfiles(json, profiles, fields); - json.endObject().close(); + writeProtobuf(protobufResponse, request, response); } - private void writeProfiles(JsonWriter json, List<QProfile> profiles, List<String> fields) { + private WsSearchResponse buildResponse(List<QProfile> profiles, List<String> fields) { Map<String, QProfile> profilesByKey = Maps.uniqueIndex(profiles, new NonNullInputFunction<QProfile, String>() { @Override protected String doApply(QProfile input) { @@ -127,8 +143,9 @@ public class SearchAction implements QProfileWsAction { Map<String, Long> activeRuleCountByKey = profileLoader.countAllActiveRules(); Map<String, Long> projectCountByKey = qualityProfileDao.countProjectsByProfileKey(); - json.name("profiles") - .beginArray(); + WsSearchResponse.Builder response = WsSearchResponse.newBuilder(); + QualityProfile.Builder profileBuilder = QualityProfile.newBuilder(); + for (QProfile profile : profiles) { if (languages.get(profile.language()) == null) { // Hide profiles on an unsupported language @@ -138,47 +155,68 @@ public class SearchAction implements QProfileWsAction { String key = profile.key(); Long activeRuleCount = activeRuleCountByKey.containsKey(key) ? activeRuleCountByKey.get(key) : 0L; Long projectCount = projectCountByKey.containsKey(key) ? projectCountByKey.get(key) : 0L; - json.beginObject() - .prop(FIELD_KEY, nullUnlessNeeded(FIELD_KEY, key, fields)) - .prop(FIELD_NAME, nullUnlessNeeded(FIELD_NAME, profile.name(), fields)) - .prop(FIELD_ACTIVE_RULE_COUNT, nullUnlessNeeded(FIELD_ACTIVE_RULE_COUNT, activeRuleCount, fields)); + profileBuilder.clear(); - if (!profile.isDefault()) { - json.prop(FIELD_PROJECT_COUNT, nullUnlessNeeded(FIELD_PROJECT_COUNT, projectCount, fields)); + if (shouldSetValue(FIELD_KEY, profile.key(), fields)) { + profileBuilder.setKey(profile.key()); + } + if (shouldSetValue(FIELD_NAME, profile.name(), fields)) { + profileBuilder.setName(profile.name()); + } + if (shouldSetValue(FIELD_ACTIVE_RULE_COUNT, activeRuleCount, fields)) { + profileBuilder.setActiveRuleCount(activeRuleCount); + } + if (!profile.isDefault() && shouldSetValue(FIELD_PROJECT_COUNT, projectCount, fields)) { + profileBuilder.setProjectCount(projectCount); } - writeLanguageFields(json, profile, fields); - writeParentFields(json, profile, fields, profilesByKey); + + writeLanguageFields(profileBuilder, profile, fields); + writeParentFields(profileBuilder, profile, fields, profilesByKey); // Special case for booleans if (fieldIsNeeded(FIELD_IS_INHERITED, fields)) { - json.prop(FIELD_IS_INHERITED, profile.isInherited()); + profileBuilder.setIsInherited(profile.isInherited()); } if (fieldIsNeeded(FIELD_IS_DEFAULT, fields)) { - json.prop(FIELD_IS_DEFAULT, profile.isDefault()); + profileBuilder.setIsDefault(profile.isDefault()); } - json.endObject(); + response.addProfiles(profileBuilder); } - json.endArray(); + + return response.build(); } - private void writeLanguageFields(JsonWriter json, QProfile profile, List<String> fields) { + private void writeLanguageFields(QualityProfile.Builder profileBuilder, QProfile profile, List<String> fields) { String languageKey = profile.language(); - json.prop(FIELD_LANGUAGE, nullUnlessNeeded(FIELD_LANGUAGE, languageKey, fields)) - .prop(FIELD_LANGUAGE_NAME, nullUnlessNeeded(FIELD_LANGUAGE_NAME, languages.get(languageKey).getName(), fields)); + if (shouldSetValue(FIELD_LANGUAGE, languageKey, fields)) { + profileBuilder.setLanguage(languageKey); + } + String languageName = languages.get(languageKey).getName(); + if (shouldSetValue(FIELD_LANGUAGE_NAME, languageName, fields)) { + profileBuilder.setLanguageName(languageName); + } } - private void writeParentFields(JsonWriter json, QProfile profile, List<String> fields, Map<String, QProfile> profilesByKey) { + private static void writeParentFields(QualityProfile.Builder profileBuilder, QProfile profile, List<String> fields, Map<String, QProfile> profilesByKey) { String parentKey = profile.parent(); QProfile parent = parentKey == null ? null : profilesByKey.get(parentKey); - json.prop(FIELD_PARENT_KEY, nullUnlessNeeded(FIELD_PARENT_KEY, parentKey, fields)) - .prop(FIELD_PARENT_NAME, nullUnlessNeeded(FIELD_PARENT_NAME, parent == null ? parentKey : parent.name(), fields)); + if (shouldSetValue(FIELD_PARENT_KEY, parentKey, fields)) { + profileBuilder.setParentKey(parentKey); + } + if (parent != null && shouldSetValue(FIELD_PARENT_NAME, parent.name(), fields)) { + profileBuilder.setParentName(parent.name()); + } } @CheckForNull - private <T> T nullUnlessNeeded(String field, T value, @Nullable List<String> fields) { + private static <T> T valueIfFieldNeeded(String field, T value, @Nullable List<String> fields) { return fieldIsNeeded(field, fields) ? value : null; } - private boolean fieldIsNeeded(String field, @Nullable List<String> fields) { + private static <T> boolean shouldSetValue(String field, T value, List<String> fields) { + return valueIfFieldNeeded(field, value, fields) != null; + } + + private static boolean fieldIsNeeded(String field, @Nullable List<String> fields) { return fields == null || fields.contains(field); } } diff --git a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/SearchActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/SearchActionTest.java index 4849101686d..4fc7b8e9ffb 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/SearchActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/qualityprofile/ws/SearchActionTest.java @@ -20,70 +20,61 @@ package org.sonar.server.qualityprofile.ws; import com.google.common.collect.ImmutableMap; -import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.junit.rules.ExpectedException; import org.sonar.api.resources.Language; import org.sonar.api.resources.Languages; import org.sonar.api.server.ws.WebService.Param; import org.sonar.api.utils.System2; +import org.sonar.db.DbClient; import org.sonar.db.DbSession; import org.sonar.db.DbTester; import org.sonar.db.component.ComponentDao; +import org.sonar.db.component.ComponentTesting; import org.sonar.db.qualityprofile.QualityProfileDao; import org.sonar.db.qualityprofile.QualityProfileDto; -import org.sonar.db.component.ComponentTesting; -import org.sonar.server.db.DbClient; import org.sonar.server.language.LanguageTesting; import org.sonar.server.qualityprofile.QProfileLoader; import org.sonar.server.qualityprofile.QProfileLookup; -import org.sonar.server.ws.WsTester; +import org.sonar.server.ws.WsActionTester; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import static org.sonar.test.JsonAssert.assertJson; public class SearchActionTest { @Rule - public DbTester dbTester = DbTester.create(System2.INSTANCE); + public DbTester db = DbTester.create(System2.INSTANCE); + @Rule + public ExpectedException expectedException = ExpectedException.none(); + // TODO remove mock + private QProfileLoader profileLoader = mock(QProfileLoader.class); private DbClient dbClient; - private QualityProfileDao qualityProfileDao; - private Language xoo1; private Language xoo2; - - private WsTester tester; - - private DbSession session; - - private QProfileLoader profileLoader; + private DbSession dbSession; + private WsActionTester ws; @Before public void setUp() { - dbTester.truncateTables(); - qualityProfileDao = new QualityProfileDao(dbTester.myBatis(), mock(System2.class)); - dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), qualityProfileDao); - session = dbClient.openSession(false); - - // TODO Replace with actual implementation after removal of DaoV2... - profileLoader = mock(QProfileLoader.class); + db.truncateTables(); + dbClient = db.getDbClient(); + qualityProfileDao = dbClient.qualityProfileDao(); + dbSession = db.getSession(); xoo1 = LanguageTesting.newLanguage("xoo1"); xoo2 = LanguageTesting.newLanguage("xoo2"); - tester = new WsTester(new QProfilesWs( - mock(RuleActivationActions.class), - mock(BulkRuleActivationActions.class), - mock(ProjectAssociationActions.class), - new SearchAction(new Languages(xoo1, xoo2), new QProfileLookup(dbClient), profileLoader, qualityProfileDao))); - } - - @After - public void teadDown() { - session.close(); + ws = new WsActionTester(new SearchAction( + new Languages(xoo1, xoo2), + new QProfileLookup(dbClient), + profileLoader, + qualityProfileDao)); } @Test @@ -91,48 +82,53 @@ public class SearchActionTest { when(profileLoader.countAllActiveRules()).thenReturn(ImmutableMap.of( "sonar-way-xoo1-12345", 11L, "my-sonar-way-xoo2-34567", 33L - )); + )); - qualityProfileDao.insert(session, + qualityProfileDao.insert(dbSession, QualityProfileDto.createFor("sonar-way-xoo1-12345").setLanguage(xoo1.getKey()).setName("Sonar way").setDefault(true), QualityProfileDto.createFor("sonar-way-xoo2-23456").setLanguage(xoo2.getKey()).setName("Sonar way"), QualityProfileDto.createFor("my-sonar-way-xoo2-34567").setLanguage(xoo2.getKey()).setName("My Sonar way").setParentKee("sonar-way-xoo2-23456"), QualityProfileDto.createFor("sonar-way-other-666").setLanguage("other").setName("Sonar way").setDefault(true) - ); - new ComponentDao().insert(session, + ); + new ComponentDao().insert(dbSession, ComponentTesting.newProjectDto("project-uuid1"), ComponentTesting.newProjectDto("project-uuid2")); - qualityProfileDao.insertProjectProfileAssociation("project-uuid1", "sonar-way-xoo2-23456", session); - qualityProfileDao.insertProjectProfileAssociation("project-uuid2", "sonar-way-xoo2-23456", session); - session.commit(); + qualityProfileDao.insertProjectProfileAssociation("project-uuid1", "sonar-way-xoo2-23456", dbSession); + qualityProfileDao.insertProjectProfileAssociation("project-uuid2", "sonar-way-xoo2-23456", dbSession); + commit(); - tester.newGetRequest("api/qualityprofiles", "search").execute().assertJson(this.getClass(), "search.json"); + String result = ws.newRequest().execute().getInput(); + + assertJson(result).isSimilarTo(getClass().getResource("SearchActionTest/search.json")); } @Test public void search_with_fields() throws Exception { - qualityProfileDao.insert(session, + qualityProfileDao.insert(dbSession, QualityProfileDto.createFor("sonar-way-xoo1-12345").setLanguage(xoo1.getKey()).setName("Sonar way").setDefault(true), QualityProfileDto.createFor("sonar-way-xoo2-23456").setLanguage(xoo2.getKey()).setName("Sonar way"), QualityProfileDto.createFor("my-sonar-way-xoo2-34567").setLanguage(xoo2.getKey()).setName("My Sonar way").setParentKee("sonar-way-xoo2-23456") - ); - session.commit(); + ); + commit(); - tester.newGetRequest("api/qualityprofiles", "search").setParam(Param.FIELDS, "key,language").execute().assertJson(this.getClass(), "search_fields.json"); - } + String result = ws.newRequest().setParam(Param.FIELDS, "key,language").execute().getInput(); - @Test(expected = IllegalArgumentException.class) - public void fail_on_unknown_fields() throws Exception { - tester.newGetRequest("api/qualityprofiles", "search").setParam(Param.FIELDS, "polop").execute(); + assertJson(result).isSimilarTo(getClass().getResource("SearchActionTest/search_fields.json")); } @Test public void search_for_language() throws Exception { - qualityProfileDao.insert(session, + qualityProfileDao.insert(dbSession, QualityProfileDto.createFor("sonar-way-xoo1-12345").setLanguage(xoo1.getKey()).setName("Sonar way") ); - session.commit(); + commit(); + + String result = ws.newRequest().setParam("language", xoo1.getKey()).execute().getInput(); + + assertJson(result).isSimilarTo(getClass().getResource("SearchActionTest/search_xoo1.json")); + } - tester.newGetRequest("api/qualityprofiles", "search").setParam("language", xoo1.getKey()).execute().assertJson(this.getClass(), "search_xoo1.json"); + private void commit() { + dbSession.commit(); } } diff --git a/sonar-ws/src/main/gen-java/org/sonarqube/ws/QualityProfiles.java b/sonar-ws/src/main/gen-java/org/sonarqube/ws/QualityProfiles.java new file mode 100644 index 00000000000..c606ae3cbaa --- /dev/null +++ b/sonar-ws/src/main/gen-java/org/sonarqube/ws/QualityProfiles.java @@ -0,0 +1,2483 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ws-qualityprofiles.proto + +package org.sonarqube.ws; + +public final class QualityProfiles { + private QualityProfiles() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + } + public interface WsSearchResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:sonarqube.ws.rules.WsSearchResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + java.util.List<org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile> + getProfilesList(); + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile getProfiles(int index); + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + int getProfilesCount(); + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + java.util.List<? extends org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfileOrBuilder> + getProfilesOrBuilderList(); + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfileOrBuilder getProfilesOrBuilder( + int index); + } + /** + * Protobuf type {@code sonarqube.ws.rules.WsSearchResponse} + * + * <pre> + * WS api/qualityprofiles/search + * </pre> + */ + public static final class WsSearchResponse extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:sonarqube.ws.rules.WsSearchResponse) + WsSearchResponseOrBuilder { + // Use WsSearchResponse.newBuilder() to construct. + private WsSearchResponse(com.google.protobuf.GeneratedMessage.Builder<?> builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private WsSearchResponse(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final WsSearchResponse defaultInstance; + public static WsSearchResponse getDefaultInstance() { + return defaultInstance; + } + + public WsSearchResponse getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private WsSearchResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + 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; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + profiles_ = new java.util.ArrayList<org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile>(); + mutable_bitField0_ |= 0x00000001; + } + profiles_.add(input.readMessage(org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.PARSER, extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + profiles_ = java.util.Collections.unmodifiableList(profiles_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonarqube.ws.QualityProfiles.internal_static_sonarqube_ws_rules_WsSearchResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonarqube.ws.QualityProfiles.internal_static_sonarqube_ws_rules_WsSearchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonarqube.ws.QualityProfiles.WsSearchResponse.class, org.sonarqube.ws.QualityProfiles.WsSearchResponse.Builder.class); + } + + public static com.google.protobuf.Parser<WsSearchResponse> PARSER = + new com.google.protobuf.AbstractParser<WsSearchResponse>() { + public WsSearchResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WsSearchResponse(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser<WsSearchResponse> getParserForType() { + return PARSER; + } + + public interface QualityProfileOrBuilder extends + // @@protoc_insertion_point(interface_extends:sonarqube.ws.rules.WsSearchResponse.QualityProfile) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>optional string key = 1;</code> + */ + boolean hasKey(); + /** + * <code>optional string key = 1;</code> + */ + java.lang.String getKey(); + /** + * <code>optional string key = 1;</code> + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + * <code>optional string name = 2;</code> + */ + boolean hasName(); + /** + * <code>optional string name = 2;</code> + */ + java.lang.String getName(); + /** + * <code>optional string name = 2;</code> + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + * <code>optional string language = 3;</code> + */ + boolean hasLanguage(); + /** + * <code>optional string language = 3;</code> + */ + java.lang.String getLanguage(); + /** + * <code>optional string language = 3;</code> + */ + com.google.protobuf.ByteString + getLanguageBytes(); + + /** + * <code>optional string languageName = 4;</code> + */ + boolean hasLanguageName(); + /** + * <code>optional string languageName = 4;</code> + */ + java.lang.String getLanguageName(); + /** + * <code>optional string languageName = 4;</code> + */ + com.google.protobuf.ByteString + getLanguageNameBytes(); + + /** + * <code>optional bool isInherited = 5;</code> + */ + boolean hasIsInherited(); + /** + * <code>optional bool isInherited = 5;</code> + */ + boolean getIsInherited(); + + /** + * <code>optional string parentKey = 6;</code> + */ + boolean hasParentKey(); + /** + * <code>optional string parentKey = 6;</code> + */ + java.lang.String getParentKey(); + /** + * <code>optional string parentKey = 6;</code> + */ + com.google.protobuf.ByteString + getParentKeyBytes(); + + /** + * <code>optional string parentName = 7;</code> + */ + boolean hasParentName(); + /** + * <code>optional string parentName = 7;</code> + */ + java.lang.String getParentName(); + /** + * <code>optional string parentName = 7;</code> + */ + com.google.protobuf.ByteString + getParentNameBytes(); + + /** + * <code>optional bool isDefault = 8;</code> + */ + boolean hasIsDefault(); + /** + * <code>optional bool isDefault = 8;</code> + */ + boolean getIsDefault(); + + /** + * <code>optional int64 activeRuleCount = 9;</code> + */ + boolean hasActiveRuleCount(); + /** + * <code>optional int64 activeRuleCount = 9;</code> + */ + long getActiveRuleCount(); + + /** + * <code>optional int64 projectCount = 10;</code> + */ + boolean hasProjectCount(); + /** + * <code>optional int64 projectCount = 10;</code> + */ + long getProjectCount(); + + /** + * <code>optional string rulesUpdatedAt = 11;</code> + */ + boolean hasRulesUpdatedAt(); + /** + * <code>optional string rulesUpdatedAt = 11;</code> + */ + java.lang.String getRulesUpdatedAt(); + /** + * <code>optional string rulesUpdatedAt = 11;</code> + */ + com.google.protobuf.ByteString + getRulesUpdatedAtBytes(); + } + /** + * Protobuf type {@code sonarqube.ws.rules.WsSearchResponse.QualityProfile} + */ + public static final class QualityProfile extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:sonarqube.ws.rules.WsSearchResponse.QualityProfile) + QualityProfileOrBuilder { + // Use QualityProfile.newBuilder() to construct. + private QualityProfile(com.google.protobuf.GeneratedMessage.Builder<?> builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private QualityProfile(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final QualityProfile defaultInstance; + public static QualityProfile getDefaultInstance() { + return defaultInstance; + } + + public QualityProfile getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private QualityProfile( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + 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; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + key_ = bs; + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + name_ = bs; + break; + } + case 26: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + language_ = bs; + break; + } + case 34: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000008; + languageName_ = bs; + break; + } + case 40: { + bitField0_ |= 0x00000010; + isInherited_ = input.readBool(); + break; + } + case 50: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000020; + parentKey_ = bs; + break; + } + case 58: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000040; + parentName_ = bs; + break; + } + case 64: { + bitField0_ |= 0x00000080; + isDefault_ = input.readBool(); + break; + } + case 72: { + bitField0_ |= 0x00000100; + activeRuleCount_ = input.readInt64(); + break; + } + case 80: { + bitField0_ |= 0x00000200; + projectCount_ = input.readInt64(); + break; + } + case 90: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000400; + rulesUpdatedAt_ = bs; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonarqube.ws.QualityProfiles.internal_static_sonarqube_ws_rules_WsSearchResponse_QualityProfile_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonarqube.ws.QualityProfiles.internal_static_sonarqube_ws_rules_WsSearchResponse_QualityProfile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.class, org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.Builder.class); + } + + public static com.google.protobuf.Parser<QualityProfile> PARSER = + new com.google.protobuf.AbstractParser<QualityProfile>() { + public QualityProfile parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QualityProfile(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser<QualityProfile> getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int KEY_FIELD_NUMBER = 1; + private java.lang.Object key_; + /** + * <code>optional string key = 1;</code> + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional string key = 1;</code> + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + if (bs.isValidUtf8()) { + key_ = s; + } + return s; + } + } + /** + * <code>optional string key = 1;</code> + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + private java.lang.Object name_; + /** + * <code>optional string name = 2;</code> + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>optional string name = 2;</code> + */ + 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(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } + } + /** + * <code>optional string name = 2;</code> + */ + 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 LANGUAGE_FIELD_NUMBER = 3; + private java.lang.Object language_; + /** + * <code>optional string language = 3;</code> + */ + public boolean hasLanguage() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>optional string language = 3;</code> + */ + public java.lang.String getLanguage() { + java.lang.Object ref = language_; + 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(); + if (bs.isValidUtf8()) { + language_ = s; + } + return s; + } + } + /** + * <code>optional string language = 3;</code> + */ + public com.google.protobuf.ByteString + getLanguageBytes() { + java.lang.Object ref = language_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + language_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGENAME_FIELD_NUMBER = 4; + private java.lang.Object languageName_; + /** + * <code>optional string languageName = 4;</code> + */ + public boolean hasLanguageName() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * <code>optional string languageName = 4;</code> + */ + public java.lang.String getLanguageName() { + java.lang.Object ref = languageName_; + 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(); + if (bs.isValidUtf8()) { + languageName_ = s; + } + return s; + } + } + /** + * <code>optional string languageName = 4;</code> + */ + public com.google.protobuf.ByteString + getLanguageNameBytes() { + java.lang.Object ref = languageName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ISINHERITED_FIELD_NUMBER = 5; + private boolean isInherited_; + /** + * <code>optional bool isInherited = 5;</code> + */ + public boolean hasIsInherited() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * <code>optional bool isInherited = 5;</code> + */ + public boolean getIsInherited() { + return isInherited_; + } + + public static final int PARENTKEY_FIELD_NUMBER = 6; + private java.lang.Object parentKey_; + /** + * <code>optional string parentKey = 6;</code> + */ + public boolean hasParentKey() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * <code>optional string parentKey = 6;</code> + */ + public java.lang.String getParentKey() { + java.lang.Object ref = parentKey_; + 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(); + if (bs.isValidUtf8()) { + parentKey_ = s; + } + return s; + } + } + /** + * <code>optional string parentKey = 6;</code> + */ + public com.google.protobuf.ByteString + getParentKeyBytes() { + java.lang.Object ref = parentKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parentKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENTNAME_FIELD_NUMBER = 7; + private java.lang.Object parentName_; + /** + * <code>optional string parentName = 7;</code> + */ + public boolean hasParentName() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * <code>optional string parentName = 7;</code> + */ + public java.lang.String getParentName() { + java.lang.Object ref = parentName_; + 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(); + if (bs.isValidUtf8()) { + parentName_ = s; + } + return s; + } + } + /** + * <code>optional string parentName = 7;</code> + */ + public com.google.protobuf.ByteString + getParentNameBytes() { + java.lang.Object ref = parentName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parentName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ISDEFAULT_FIELD_NUMBER = 8; + private boolean isDefault_; + /** + * <code>optional bool isDefault = 8;</code> + */ + public boolean hasIsDefault() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * <code>optional bool isDefault = 8;</code> + */ + public boolean getIsDefault() { + return isDefault_; + } + + public static final int ACTIVERULECOUNT_FIELD_NUMBER = 9; + private long activeRuleCount_; + /** + * <code>optional int64 activeRuleCount = 9;</code> + */ + public boolean hasActiveRuleCount() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * <code>optional int64 activeRuleCount = 9;</code> + */ + public long getActiveRuleCount() { + return activeRuleCount_; + } + + public static final int PROJECTCOUNT_FIELD_NUMBER = 10; + private long projectCount_; + /** + * <code>optional int64 projectCount = 10;</code> + */ + public boolean hasProjectCount() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * <code>optional int64 projectCount = 10;</code> + */ + public long getProjectCount() { + return projectCount_; + } + + public static final int RULESUPDATEDAT_FIELD_NUMBER = 11; + private java.lang.Object rulesUpdatedAt_; + /** + * <code>optional string rulesUpdatedAt = 11;</code> + */ + public boolean hasRulesUpdatedAt() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * <code>optional string rulesUpdatedAt = 11;</code> + */ + public java.lang.String getRulesUpdatedAt() { + java.lang.Object ref = rulesUpdatedAt_; + 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(); + if (bs.isValidUtf8()) { + rulesUpdatedAt_ = s; + } + return s; + } + } + /** + * <code>optional string rulesUpdatedAt = 11;</code> + */ + public com.google.protobuf.ByteString + getRulesUpdatedAtBytes() { + java.lang.Object ref = rulesUpdatedAt_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + rulesUpdatedAt_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + key_ = ""; + name_ = ""; + language_ = ""; + languageName_ = ""; + isInherited_ = false; + parentKey_ = ""; + parentName_ = ""; + isDefault_ = false; + activeRuleCount_ = 0L; + projectCount_ = 0L; + rulesUpdatedAt_ = ""; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getKeyBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getNameBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, getLanguageBytes()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(4, getLanguageNameBytes()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBool(5, isInherited_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeBytes(6, getParentKeyBytes()); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeBytes(7, getParentNameBytes()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeBool(8, isDefault_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeInt64(9, activeRuleCount_); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + output.writeInt64(10, projectCount_); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + output.writeBytes(11, getRulesUpdatedAtBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getKeyBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getNameBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, getLanguageBytes()); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, getLanguageNameBytes()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(5, isInherited_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(6, getParentKeyBytes()); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(7, getParentNameBytes()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(8, isDefault_); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, activeRuleCount_); + } + if (((bitField0_ & 0x00000200) == 0x00000200)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(10, projectCount_); + } + if (((bitField0_ & 0x00000400) == 0x00000400)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(11, getRulesUpdatedAtBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code sonarqube.ws.rules.WsSearchResponse.QualityProfile} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:sonarqube.ws.rules.WsSearchResponse.QualityProfile) + org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfileOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonarqube.ws.QualityProfiles.internal_static_sonarqube_ws_rules_WsSearchResponse_QualityProfile_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonarqube.ws.QualityProfiles.internal_static_sonarqube_ws_rules_WsSearchResponse_QualityProfile_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.class, org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.Builder.class); + } + + // Construct using org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + key_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + name_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + language_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + languageName_ = ""; + bitField0_ = (bitField0_ & ~0x00000008); + isInherited_ = false; + bitField0_ = (bitField0_ & ~0x00000010); + parentKey_ = ""; + bitField0_ = (bitField0_ & ~0x00000020); + parentName_ = ""; + bitField0_ = (bitField0_ & ~0x00000040); + isDefault_ = false; + bitField0_ = (bitField0_ & ~0x00000080); + activeRuleCount_ = 0L; + bitField0_ = (bitField0_ & ~0x00000100); + projectCount_ = 0L; + bitField0_ = (bitField0_ & ~0x00000200); + rulesUpdatedAt_ = ""; + bitField0_ = (bitField0_ & ~0x00000400); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.sonarqube.ws.QualityProfiles.internal_static_sonarqube_ws_rules_WsSearchResponse_QualityProfile_descriptor; + } + + public org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile getDefaultInstanceForType() { + return org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.getDefaultInstance(); + } + + public org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile build() { + org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile buildPartial() { + org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile result = new org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.key_ = key_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.name_ = name_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.language_ = language_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.languageName_ = languageName_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.isInherited_ = isInherited_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.parentKey_ = parentKey_; + if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + to_bitField0_ |= 0x00000040; + } + result.parentName_ = parentName_; + if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + to_bitField0_ |= 0x00000080; + } + result.isDefault_ = isDefault_; + if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + to_bitField0_ |= 0x00000100; + } + result.activeRuleCount_ = activeRuleCount_; + if (((from_bitField0_ & 0x00000200) == 0x00000200)) { + to_bitField0_ |= 0x00000200; + } + result.projectCount_ = projectCount_; + if (((from_bitField0_ & 0x00000400) == 0x00000400)) { + to_bitField0_ |= 0x00000400; + } + result.rulesUpdatedAt_ = rulesUpdatedAt_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile) { + return mergeFrom((org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile other) { + if (other == org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.getDefaultInstance()) return this; + if (other.hasKey()) { + bitField0_ |= 0x00000001; + key_ = other.key_; + onChanged(); + } + if (other.hasName()) { + bitField0_ |= 0x00000002; + name_ = other.name_; + onChanged(); + } + if (other.hasLanguage()) { + bitField0_ |= 0x00000004; + language_ = other.language_; + onChanged(); + } + if (other.hasLanguageName()) { + bitField0_ |= 0x00000008; + languageName_ = other.languageName_; + onChanged(); + } + if (other.hasIsInherited()) { + setIsInherited(other.getIsInherited()); + } + if (other.hasParentKey()) { + bitField0_ |= 0x00000020; + parentKey_ = other.parentKey_; + onChanged(); + } + if (other.hasParentName()) { + bitField0_ |= 0x00000040; + parentName_ = other.parentName_; + onChanged(); + } + if (other.hasIsDefault()) { + setIsDefault(other.getIsDefault()); + } + if (other.hasActiveRuleCount()) { + setActiveRuleCount(other.getActiveRuleCount()); + } + if (other.hasProjectCount()) { + setProjectCount(other.getProjectCount()); + } + if (other.hasRulesUpdatedAt()) { + bitField0_ |= 0x00000400; + rulesUpdatedAt_ = other.rulesUpdatedAt_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + * <code>optional string key = 1;</code> + */ + public boolean hasKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * <code>optional string key = 1;</code> + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + key_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string key = 1;</code> + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string key = 1;</code> + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + key_ = value; + onChanged(); + return this; + } + /** + * <code>optional string key = 1;</code> + */ + public Builder clearKey() { + bitField0_ = (bitField0_ & ~0x00000001); + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + * <code>optional string key = 1;</code> + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * <code>optional string name = 2;</code> + */ + public boolean hasName() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * <code>optional string name = 2;</code> + */ + 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(); + if (bs.isValidUtf8()) { + name_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string name = 2;</code> + */ + 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>optional string name = 2;</code> + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + name_ = value; + onChanged(); + return this; + } + /** + * <code>optional string name = 2;</code> + */ + public Builder clearName() { + bitField0_ = (bitField0_ & ~0x00000002); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * <code>optional string name = 2;</code> + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object language_ = ""; + /** + * <code>optional string language = 3;</code> + */ + public boolean hasLanguage() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * <code>optional string language = 3;</code> + */ + public java.lang.String getLanguage() { + java.lang.Object ref = language_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + language_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string language = 3;</code> + */ + public com.google.protobuf.ByteString + getLanguageBytes() { + java.lang.Object ref = language_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + language_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string language = 3;</code> + */ + public Builder setLanguage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + language_ = value; + onChanged(); + return this; + } + /** + * <code>optional string language = 3;</code> + */ + public Builder clearLanguage() { + bitField0_ = (bitField0_ & ~0x00000004); + language_ = getDefaultInstance().getLanguage(); + onChanged(); + return this; + } + /** + * <code>optional string language = 3;</code> + */ + public Builder setLanguageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + language_ = value; + onChanged(); + return this; + } + + private java.lang.Object languageName_ = ""; + /** + * <code>optional string languageName = 4;</code> + */ + public boolean hasLanguageName() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * <code>optional string languageName = 4;</code> + */ + public java.lang.String getLanguageName() { + java.lang.Object ref = languageName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + languageName_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string languageName = 4;</code> + */ + public com.google.protobuf.ByteString + getLanguageNameBytes() { + java.lang.Object ref = languageName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string languageName = 4;</code> + */ + public Builder setLanguageName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + languageName_ = value; + onChanged(); + return this; + } + /** + * <code>optional string languageName = 4;</code> + */ + public Builder clearLanguageName() { + bitField0_ = (bitField0_ & ~0x00000008); + languageName_ = getDefaultInstance().getLanguageName(); + onChanged(); + return this; + } + /** + * <code>optional string languageName = 4;</code> + */ + public Builder setLanguageNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + languageName_ = value; + onChanged(); + return this; + } + + private boolean isInherited_ ; + /** + * <code>optional bool isInherited = 5;</code> + */ + public boolean hasIsInherited() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * <code>optional bool isInherited = 5;</code> + */ + public boolean getIsInherited() { + return isInherited_; + } + /** + * <code>optional bool isInherited = 5;</code> + */ + public Builder setIsInherited(boolean value) { + bitField0_ |= 0x00000010; + isInherited_ = value; + onChanged(); + return this; + } + /** + * <code>optional bool isInherited = 5;</code> + */ + public Builder clearIsInherited() { + bitField0_ = (bitField0_ & ~0x00000010); + isInherited_ = false; + onChanged(); + return this; + } + + private java.lang.Object parentKey_ = ""; + /** + * <code>optional string parentKey = 6;</code> + */ + public boolean hasParentKey() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * <code>optional string parentKey = 6;</code> + */ + public java.lang.String getParentKey() { + java.lang.Object ref = parentKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + parentKey_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string parentKey = 6;</code> + */ + public com.google.protobuf.ByteString + getParentKeyBytes() { + java.lang.Object ref = parentKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parentKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string parentKey = 6;</code> + */ + public Builder setParentKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + parentKey_ = value; + onChanged(); + return this; + } + /** + * <code>optional string parentKey = 6;</code> + */ + public Builder clearParentKey() { + bitField0_ = (bitField0_ & ~0x00000020); + parentKey_ = getDefaultInstance().getParentKey(); + onChanged(); + return this; + } + /** + * <code>optional string parentKey = 6;</code> + */ + public Builder setParentKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + parentKey_ = value; + onChanged(); + return this; + } + + private java.lang.Object parentName_ = ""; + /** + * <code>optional string parentName = 7;</code> + */ + public boolean hasParentName() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * <code>optional string parentName = 7;</code> + */ + public java.lang.String getParentName() { + java.lang.Object ref = parentName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + parentName_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string parentName = 7;</code> + */ + public com.google.protobuf.ByteString + getParentNameBytes() { + java.lang.Object ref = parentName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parentName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string parentName = 7;</code> + */ + public Builder setParentName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + parentName_ = value; + onChanged(); + return this; + } + /** + * <code>optional string parentName = 7;</code> + */ + public Builder clearParentName() { + bitField0_ = (bitField0_ & ~0x00000040); + parentName_ = getDefaultInstance().getParentName(); + onChanged(); + return this; + } + /** + * <code>optional string parentName = 7;</code> + */ + public Builder setParentNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + parentName_ = value; + onChanged(); + return this; + } + + private boolean isDefault_ ; + /** + * <code>optional bool isDefault = 8;</code> + */ + public boolean hasIsDefault() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * <code>optional bool isDefault = 8;</code> + */ + public boolean getIsDefault() { + return isDefault_; + } + /** + * <code>optional bool isDefault = 8;</code> + */ + public Builder setIsDefault(boolean value) { + bitField0_ |= 0x00000080; + isDefault_ = value; + onChanged(); + return this; + } + /** + * <code>optional bool isDefault = 8;</code> + */ + public Builder clearIsDefault() { + bitField0_ = (bitField0_ & ~0x00000080); + isDefault_ = false; + onChanged(); + return this; + } + + private long activeRuleCount_ ; + /** + * <code>optional int64 activeRuleCount = 9;</code> + */ + public boolean hasActiveRuleCount() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * <code>optional int64 activeRuleCount = 9;</code> + */ + public long getActiveRuleCount() { + return activeRuleCount_; + } + /** + * <code>optional int64 activeRuleCount = 9;</code> + */ + public Builder setActiveRuleCount(long value) { + bitField0_ |= 0x00000100; + activeRuleCount_ = value; + onChanged(); + return this; + } + /** + * <code>optional int64 activeRuleCount = 9;</code> + */ + public Builder clearActiveRuleCount() { + bitField0_ = (bitField0_ & ~0x00000100); + activeRuleCount_ = 0L; + onChanged(); + return this; + } + + private long projectCount_ ; + /** + * <code>optional int64 projectCount = 10;</code> + */ + public boolean hasProjectCount() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * <code>optional int64 projectCount = 10;</code> + */ + public long getProjectCount() { + return projectCount_; + } + /** + * <code>optional int64 projectCount = 10;</code> + */ + public Builder setProjectCount(long value) { + bitField0_ |= 0x00000200; + projectCount_ = value; + onChanged(); + return this; + } + /** + * <code>optional int64 projectCount = 10;</code> + */ + public Builder clearProjectCount() { + bitField0_ = (bitField0_ & ~0x00000200); + projectCount_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object rulesUpdatedAt_ = ""; + /** + * <code>optional string rulesUpdatedAt = 11;</code> + */ + public boolean hasRulesUpdatedAt() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * <code>optional string rulesUpdatedAt = 11;</code> + */ + public java.lang.String getRulesUpdatedAt() { + java.lang.Object ref = rulesUpdatedAt_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + rulesUpdatedAt_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>optional string rulesUpdatedAt = 11;</code> + */ + public com.google.protobuf.ByteString + getRulesUpdatedAtBytes() { + java.lang.Object ref = rulesUpdatedAt_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + rulesUpdatedAt_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>optional string rulesUpdatedAt = 11;</code> + */ + public Builder setRulesUpdatedAt( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + rulesUpdatedAt_ = value; + onChanged(); + return this; + } + /** + * <code>optional string rulesUpdatedAt = 11;</code> + */ + public Builder clearRulesUpdatedAt() { + bitField0_ = (bitField0_ & ~0x00000400); + rulesUpdatedAt_ = getDefaultInstance().getRulesUpdatedAt(); + onChanged(); + return this; + } + /** + * <code>optional string rulesUpdatedAt = 11;</code> + */ + public Builder setRulesUpdatedAtBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000400; + rulesUpdatedAt_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:sonarqube.ws.rules.WsSearchResponse.QualityProfile) + } + + static { + defaultInstance = new QualityProfile(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:sonarqube.ws.rules.WsSearchResponse.QualityProfile) + } + + public static final int PROFILES_FIELD_NUMBER = 1; + private java.util.List<org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile> profiles_; + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public java.util.List<org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile> getProfilesList() { + return profiles_; + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public java.util.List<? extends org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfileOrBuilder> + getProfilesOrBuilderList() { + return profiles_; + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public int getProfilesCount() { + return profiles_.size(); + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile getProfiles(int index) { + return profiles_.get(index); + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfileOrBuilder getProfilesOrBuilder( + int index) { + return profiles_.get(index); + } + + private void initFields() { + profiles_ = java.util.Collections.emptyList(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < profiles_.size(); i++) { + output.writeMessage(1, profiles_.get(i)); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < profiles_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, profiles_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.sonarqube.ws.QualityProfiles.WsSearchResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.sonarqube.ws.QualityProfiles.WsSearchResponse prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code sonarqube.ws.rules.WsSearchResponse} + * + * <pre> + * WS api/qualityprofiles/search + * </pre> + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:sonarqube.ws.rules.WsSearchResponse) + org.sonarqube.ws.QualityProfiles.WsSearchResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.sonarqube.ws.QualityProfiles.internal_static_sonarqube_ws_rules_WsSearchResponse_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.sonarqube.ws.QualityProfiles.internal_static_sonarqube_ws_rules_WsSearchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.sonarqube.ws.QualityProfiles.WsSearchResponse.class, org.sonarqube.ws.QualityProfiles.WsSearchResponse.Builder.class); + } + + // Construct using org.sonarqube.ws.QualityProfiles.WsSearchResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getProfilesFieldBuilder(); + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + if (profilesBuilder_ == null) { + profiles_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + profilesBuilder_.clear(); + } + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.sonarqube.ws.QualityProfiles.internal_static_sonarqube_ws_rules_WsSearchResponse_descriptor; + } + + public org.sonarqube.ws.QualityProfiles.WsSearchResponse getDefaultInstanceForType() { + return org.sonarqube.ws.QualityProfiles.WsSearchResponse.getDefaultInstance(); + } + + public org.sonarqube.ws.QualityProfiles.WsSearchResponse build() { + org.sonarqube.ws.QualityProfiles.WsSearchResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.sonarqube.ws.QualityProfiles.WsSearchResponse buildPartial() { + org.sonarqube.ws.QualityProfiles.WsSearchResponse result = new org.sonarqube.ws.QualityProfiles.WsSearchResponse(this); + int from_bitField0_ = bitField0_; + if (profilesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + profiles_ = java.util.Collections.unmodifiableList(profiles_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.profiles_ = profiles_; + } else { + result.profiles_ = profilesBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.sonarqube.ws.QualityProfiles.WsSearchResponse) { + return mergeFrom((org.sonarqube.ws.QualityProfiles.WsSearchResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.sonarqube.ws.QualityProfiles.WsSearchResponse other) { + if (other == org.sonarqube.ws.QualityProfiles.WsSearchResponse.getDefaultInstance()) return this; + if (profilesBuilder_ == null) { + if (!other.profiles_.isEmpty()) { + if (profiles_.isEmpty()) { + profiles_ = other.profiles_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProfilesIsMutable(); + profiles_.addAll(other.profiles_); + } + onChanged(); + } + } else { + if (!other.profiles_.isEmpty()) { + if (profilesBuilder_.isEmpty()) { + profilesBuilder_.dispose(); + profilesBuilder_ = null; + profiles_ = other.profiles_; + bitField0_ = (bitField0_ & ~0x00000001); + profilesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getProfilesFieldBuilder() : null; + } else { + profilesBuilder_.addAllMessages(other.profiles_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.sonarqube.ws.QualityProfiles.WsSearchResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.sonarqube.ws.QualityProfiles.WsSearchResponse) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List<org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile> profiles_ = + java.util.Collections.emptyList(); + private void ensureProfilesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + profiles_ = new java.util.ArrayList<org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile>(profiles_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile, org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.Builder, org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfileOrBuilder> profilesBuilder_; + + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public java.util.List<org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile> getProfilesList() { + if (profilesBuilder_ == null) { + return java.util.Collections.unmodifiableList(profiles_); + } else { + return profilesBuilder_.getMessageList(); + } + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public int getProfilesCount() { + if (profilesBuilder_ == null) { + return profiles_.size(); + } else { + return profilesBuilder_.getCount(); + } + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile getProfiles(int index) { + if (profilesBuilder_ == null) { + return profiles_.get(index); + } else { + return profilesBuilder_.getMessage(index); + } + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public Builder setProfiles( + int index, org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile value) { + if (profilesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProfilesIsMutable(); + profiles_.set(index, value); + onChanged(); + } else { + profilesBuilder_.setMessage(index, value); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public Builder setProfiles( + int index, org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.Builder builderForValue) { + if (profilesBuilder_ == null) { + ensureProfilesIsMutable(); + profiles_.set(index, builderForValue.build()); + onChanged(); + } else { + profilesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public Builder addProfiles(org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile value) { + if (profilesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProfilesIsMutable(); + profiles_.add(value); + onChanged(); + } else { + profilesBuilder_.addMessage(value); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public Builder addProfiles( + int index, org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile value) { + if (profilesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProfilesIsMutable(); + profiles_.add(index, value); + onChanged(); + } else { + profilesBuilder_.addMessage(index, value); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public Builder addProfiles( + org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.Builder builderForValue) { + if (profilesBuilder_ == null) { + ensureProfilesIsMutable(); + profiles_.add(builderForValue.build()); + onChanged(); + } else { + profilesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public Builder addProfiles( + int index, org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.Builder builderForValue) { + if (profilesBuilder_ == null) { + ensureProfilesIsMutable(); + profiles_.add(index, builderForValue.build()); + onChanged(); + } else { + profilesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public Builder addAllProfiles( + java.lang.Iterable<? extends org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile> values) { + if (profilesBuilder_ == null) { + ensureProfilesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, profiles_); + onChanged(); + } else { + profilesBuilder_.addAllMessages(values); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public Builder clearProfiles() { + if (profilesBuilder_ == null) { + profiles_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + profilesBuilder_.clear(); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public Builder removeProfiles(int index) { + if (profilesBuilder_ == null) { + ensureProfilesIsMutable(); + profiles_.remove(index); + onChanged(); + } else { + profilesBuilder_.remove(index); + } + return this; + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.Builder getProfilesBuilder( + int index) { + return getProfilesFieldBuilder().getBuilder(index); + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfileOrBuilder getProfilesOrBuilder( + int index) { + if (profilesBuilder_ == null) { + return profiles_.get(index); } else { + return profilesBuilder_.getMessageOrBuilder(index); + } + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public java.util.List<? extends org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfileOrBuilder> + getProfilesOrBuilderList() { + if (profilesBuilder_ != null) { + return profilesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(profiles_); + } + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.Builder addProfilesBuilder() { + return getProfilesFieldBuilder().addBuilder( + org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.getDefaultInstance()); + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.Builder addProfilesBuilder( + int index) { + return getProfilesFieldBuilder().addBuilder( + index, org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.getDefaultInstance()); + } + /** + * <code>repeated .sonarqube.ws.rules.WsSearchResponse.QualityProfile profiles = 1;</code> + */ + public java.util.List<org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.Builder> + getProfilesBuilderList() { + return getProfilesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile, org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.Builder, org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfileOrBuilder> + getProfilesFieldBuilder() { + if (profilesBuilder_ == null) { + profilesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile, org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfile.Builder, org.sonarqube.ws.QualityProfiles.WsSearchResponse.QualityProfileOrBuilder>( + profiles_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + profiles_ = null; + } + return profilesBuilder_; + } + + // @@protoc_insertion_point(builder_scope:sonarqube.ws.rules.WsSearchResponse) + } + + static { + defaultInstance = new WsSearchResponse(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:sonarqube.ws.rules.WsSearchResponse) + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_sonarqube_ws_rules_WsSearchResponse_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_sonarqube_ws_rules_WsSearchResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_sonarqube_ws_rules_WsSearchResponse_QualityProfile_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_sonarqube_ws_rules_WsSearchResponse_QualityProfile_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\030ws-qualityprofiles.proto\022\022sonarqube.ws" + + ".rules\"\305\002\n\020WsSearchResponse\022E\n\010profiles\030" + + "\001 \003(\01323.sonarqube.ws.rules.WsSearchRespo" + + "nse.QualityProfile\032\351\001\n\016QualityProfile\022\013\n" + + "\003key\030\001 \001(\t\022\014\n\004name\030\002 \001(\t\022\020\n\010language\030\003 \001" + + "(\t\022\024\n\014languageName\030\004 \001(\t\022\023\n\013isInherited\030" + + "\005 \001(\010\022\021\n\tparentKey\030\006 \001(\t\022\022\n\nparentName\030\007" + + " \001(\t\022\021\n\tisDefault\030\010 \001(\010\022\027\n\017activeRuleCou" + + "nt\030\t \001(\003\022\024\n\014projectCount\030\n \001(\003\022\026\n\016rulesU" + + "pdatedAt\030\013 \001(\tB%\n\020org.sonarqube.wsB\017Qual", + "ityProfilesH\001" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }, assigner); + internal_static_sonarqube_ws_rules_WsSearchResponse_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_sonarqube_ws_rules_WsSearchResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_sonarqube_ws_rules_WsSearchResponse_descriptor, + new java.lang.String[] { "Profiles", }); + internal_static_sonarqube_ws_rules_WsSearchResponse_QualityProfile_descriptor = + internal_static_sonarqube_ws_rules_WsSearchResponse_descriptor.getNestedTypes().get(0); + internal_static_sonarqube_ws_rules_WsSearchResponse_QualityProfile_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_sonarqube_ws_rules_WsSearchResponse_QualityProfile_descriptor, + new java.lang.String[] { "Key", "Name", "Language", "LanguageName", "IsInherited", "ParentKey", "ParentName", "IsDefault", "ActiveRuleCount", "ProjectCount", "RulesUpdatedAt", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/sonar-ws/src/main/protobuf/ws-qualityprofiles.proto b/sonar-ws/src/main/protobuf/ws-qualityprofiles.proto new file mode 100644 index 00000000000..f3708259d24 --- /dev/null +++ b/sonar-ws/src/main/protobuf/ws-qualityprofiles.proto @@ -0,0 +1,46 @@ +// SonarQube, open source software quality management tool. +// Copyright (C) 2008-2015 SonarSource +// mailto:contact AT sonarsource DOT com +// +// SonarQube is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 3 of the License, or (at your option) any later version. +// +// SonarQube is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program; if not, write to the Free Software Foundation, +// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +syntax = "proto2"; + +package sonarqube.ws.rules; + +option java_package = "org.sonarqube.ws"; + +option java_outer_classname = "QualityProfiles"; + +option optimize_for = SPEED; + +// WS api/qualityprofiles/search +message WsSearchResponse { + repeated QualityProfile profiles = 1; + + message QualityProfile { + optional string key = 1; + optional string name = 2; + optional string language = 3; + optional string languageName = 4; + optional bool isInherited = 5; + optional string parentKey = 6; + optional string parentName = 7; + optional bool isDefault = 8; + optional int64 activeRuleCount = 9; + optional int64 projectCount = 10; + optional string rulesUpdatedAt = 11; + } +} |