com.google.javascript.jscomp.Requirement Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.frontend.js.minifier
Show all versions of com.liferay.frontend.js.minifier
Liferay Frontend JS Minifier
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: conformance.proto
package com.google.javascript.jscomp;
/**
*
* A specification of code requirements
*
*
* Protobuf type {@code jscomp.Requirement}
*/
public final class Requirement extends
com.google.protobuf.GeneratedMessageV3.ExtendableMessage<
Requirement> implements
// @@protoc_insertion_point(message_implements:jscomp.Requirement)
RequirementOrBuilder {
// Use Requirement.newBuilder() to construct.
private Requirement(com.google.protobuf.GeneratedMessageV3.ExtendableBuilder builder) {
super(builder);
}
private Requirement() {
errorMessage_ = "";
whitelist_ = com.google.protobuf.LazyStringArrayList.EMPTY;
whitelistRegexp_ = com.google.protobuf.LazyStringArrayList.EMPTY;
onlyApplyTo_ = com.google.protobuf.LazyStringArrayList.EMPTY;
onlyApplyToRegexp_ = com.google.protobuf.LazyStringArrayList.EMPTY;
type_ = 1;
value_ = com.google.protobuf.LazyStringArrayList.EMPTY;
typeMatchingStrategy_ = 1;
javaClass_ = "";
ruleId_ = "";
extends_ = "";
reportLooseTypeViolations_ = true;
severity_ = 1;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Requirement(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
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;
errorMessage_ = bs;
break;
}
case 18: {
com.google.protobuf.ByteString bs = input.readBytes();
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
whitelist_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000002;
}
whitelist_.add(bs);
break;
}
case 26: {
com.google.protobuf.ByteString bs = input.readBytes();
if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
whitelistRegexp_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000004;
}
whitelistRegexp_.add(bs);
break;
}
case 34: {
com.google.protobuf.ByteString bs = input.readBytes();
if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
onlyApplyTo_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000008;
}
onlyApplyTo_.add(bs);
break;
}
case 42: {
com.google.protobuf.ByteString bs = input.readBytes();
if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
onlyApplyToRegexp_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000010;
}
onlyApplyToRegexp_.add(bs);
break;
}
case 48: {
int rawValue = input.readEnum();
com.google.javascript.jscomp.Requirement.Type value = com.google.javascript.jscomp.Requirement.Type.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(6, rawValue);
} else {
bitField0_ |= 0x00000002;
type_ = rawValue;
}
break;
}
case 58: {
com.google.protobuf.ByteString bs = input.readBytes();
if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
value_ = new com.google.protobuf.LazyStringArrayList();
mutable_bitField0_ |= 0x00000040;
}
value_.add(bs);
break;
}
case 66: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000008;
javaClass_ = bs;
break;
}
case 74: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000010;
ruleId_ = bs;
break;
}
case 82: {
com.google.protobuf.ByteString bs = input.readBytes();
bitField0_ |= 0x00000020;
extends_ = bs;
break;
}
case 88: {
bitField0_ |= 0x00000040;
reportLooseTypeViolations_ = input.readBool();
break;
}
case 96: {
int rawValue = input.readEnum();
com.google.javascript.jscomp.Requirement.Severity value = com.google.javascript.jscomp.Requirement.Severity.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(12, rawValue);
} else {
bitField0_ |= 0x00000080;
severity_ = rawValue;
}
break;
}
case 104: {
int rawValue = input.readEnum();
com.google.javascript.jscomp.Requirement.TypeMatchingStrategy value = com.google.javascript.jscomp.Requirement.TypeMatchingStrategy.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(13, rawValue);
} else {
bitField0_ |= 0x00000004;
typeMatchingStrategy_ = rawValue;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
whitelist_ = whitelist_.getUnmodifiableView();
}
if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
whitelistRegexp_ = whitelistRegexp_.getUnmodifiableView();
}
if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
onlyApplyTo_ = onlyApplyTo_.getUnmodifiableView();
}
if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
onlyApplyToRegexp_ = onlyApplyToRegexp_.getUnmodifiableView();
}
if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
value_ = value_.getUnmodifiableView();
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.javascript.jscomp.Conformance.internal_static_jscomp_Requirement_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.javascript.jscomp.Conformance.internal_static_jscomp_Requirement_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.javascript.jscomp.Requirement.class, com.google.javascript.jscomp.Requirement.Builder.class);
}
/**
*
* A classification of the requirement and how it is enforced.
*
*
* Protobuf enum {@code jscomp.Requirement.Type}
*/
public enum Type
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* A requirement enforced with code a external java class.
*
*
* CUSTOM = 1;
*/
CUSTOM(1),
/**
*
* A forbidden source file
*
*
* BANNED_DEPENDENCY = 2;
*/
BANNED_DEPENDENCY(2),
/**
*
* A forbidden fully distinguished name. For example:
* - A global name like "eval" or "goog"
* - A namespaced value or type: namespace.Banned
* - A 'static' property: "namespace.Foo.banned"
*
*
* BANNED_NAME = 3;
*/
BANNED_NAME(3),
/**
*
* A banned instance property, for example:
* - An 'instance' property: "namespace.Foo.prototype.banned"
* - All properties of a given name "Object.prototype.banned"
*
*
* BANNED_PROPERTY = 4;
*/
BANNED_PROPERTY(4),
/**
*
* A banned reading from an instance property, for example:
* - An 'instance' property: "namespace.Foo.prototype.banned"
* - All properties of a given name "Object.prototype.banned"
* Unlike BANNED_PROPERTY, this only bans reads to the property,
* i.e. its use as an rvalue.
*
*
* BANNED_PROPERTY_READ = 5;
*/
BANNED_PROPERTY_READ(5),
/**
*
* A banned write to an instance property, for example:
* - An 'instance' property: "namespace.Foo.prototype.banned"
* - All properties of a given name "Object.prototype.banned"
* Unlike BANNED_PROPERTY, this only bans assignments to the property,
* i.e. its use as an lvalue.
*
*
* BANNED_PROPERTY_WRITE = 6;
*/
BANNED_PROPERTY_WRITE(6),
/**
*
* A restricted call, for example:
* - the "parseInt" call must be called with a radix:
* parseInt:function(string, int)
*
*
* RESTRICTED_NAME_CALL = 7;
*/
RESTRICTED_NAME_CALL(7),
/**
*
* A restricted call, for example:
* - The unsafe opt_html parameter must not be passed to createNode:
* goog.ui.tree.TreeControl.prototype.createNode:function()
*
*
* RESTRICTED_METHOD_CALL = 8;
*/
RESTRICTED_METHOD_CALL(8),
/**
*
* A banned code pattern. This check is done using against an AST.
* To ban a call to eval:
* "/** @param {?} a */ function template(a) {eval(a);}"
*
*
* BANNED_CODE_PATTERN = 9;
*/
BANNED_CODE_PATTERN(9),
/**
*
* A banned function call. for example:
* - An 'instance' property: "namespace.Foo.prototype.banned"
* - All properties of a given name "Object.prototype.banned"
* Unlike BANNED_PROPERTY, this only bans calls to the property
* i.e. using the property as a value is allowed.
*
*
* BANNED_PROPERTY_CALL = 10;
*/
BANNED_PROPERTY_CALL(10),
/**
*
* A banned write of a non-constant value to an instance property.
* Unlike BANNED_PROPERTY_WRITE, this only bans assignments of a
* non-constant value.
*
*
* BANNED_PROPERTY_NON_CONSTANT_WRITE = 11;
*/
BANNED_PROPERTY_NON_CONSTANT_WRITE(11),
/**
*
* A banned function call.
* Unlike BANNED_NAME, this only bans calls to the property, i.e. using the
* property as a value is allowed.
*
*
* BANNED_NAME_CALL = 12;
*/
BANNED_NAME_CALL(12),
;
/**
*
* A requirement enforced with code a external java class.
*
*
* CUSTOM = 1;
*/
public static final int CUSTOM_VALUE = 1;
/**
*
* A forbidden source file
*
*
* BANNED_DEPENDENCY = 2;
*/
public static final int BANNED_DEPENDENCY_VALUE = 2;
/**
*
* A forbidden fully distinguished name. For example:
* - A global name like "eval" or "goog"
* - A namespaced value or type: namespace.Banned
* - A 'static' property: "namespace.Foo.banned"
*
*
* BANNED_NAME = 3;
*/
public static final int BANNED_NAME_VALUE = 3;
/**
*
* A banned instance property, for example:
* - An 'instance' property: "namespace.Foo.prototype.banned"
* - All properties of a given name "Object.prototype.banned"
*
*
* BANNED_PROPERTY = 4;
*/
public static final int BANNED_PROPERTY_VALUE = 4;
/**
*
* A banned reading from an instance property, for example:
* - An 'instance' property: "namespace.Foo.prototype.banned"
* - All properties of a given name "Object.prototype.banned"
* Unlike BANNED_PROPERTY, this only bans reads to the property,
* i.e. its use as an rvalue.
*
*
* BANNED_PROPERTY_READ = 5;
*/
public static final int BANNED_PROPERTY_READ_VALUE = 5;
/**
*
* A banned write to an instance property, for example:
* - An 'instance' property: "namespace.Foo.prototype.banned"
* - All properties of a given name "Object.prototype.banned"
* Unlike BANNED_PROPERTY, this only bans assignments to the property,
* i.e. its use as an lvalue.
*
*
* BANNED_PROPERTY_WRITE = 6;
*/
public static final int BANNED_PROPERTY_WRITE_VALUE = 6;
/**
*
* A restricted call, for example:
* - the "parseInt" call must be called with a radix:
* parseInt:function(string, int)
*
*
* RESTRICTED_NAME_CALL = 7;
*/
public static final int RESTRICTED_NAME_CALL_VALUE = 7;
/**
*
* A restricted call, for example:
* - The unsafe opt_html parameter must not be passed to createNode:
* goog.ui.tree.TreeControl.prototype.createNode:function()
*
*
* RESTRICTED_METHOD_CALL = 8;
*/
public static final int RESTRICTED_METHOD_CALL_VALUE = 8;
/**
*
* A banned code pattern. This check is done using against an AST.
* To ban a call to eval:
* "/** @param {?} a */ function template(a) {eval(a);}"
*
*
* BANNED_CODE_PATTERN = 9;
*/
public static final int BANNED_CODE_PATTERN_VALUE = 9;
/**
*
* A banned function call. for example:
* - An 'instance' property: "namespace.Foo.prototype.banned"
* - All properties of a given name "Object.prototype.banned"
* Unlike BANNED_PROPERTY, this only bans calls to the property
* i.e. using the property as a value is allowed.
*
*
* BANNED_PROPERTY_CALL = 10;
*/
public static final int BANNED_PROPERTY_CALL_VALUE = 10;
/**
*
* A banned write of a non-constant value to an instance property.
* Unlike BANNED_PROPERTY_WRITE, this only bans assignments of a
* non-constant value.
*
*
* BANNED_PROPERTY_NON_CONSTANT_WRITE = 11;
*/
public static final int BANNED_PROPERTY_NON_CONSTANT_WRITE_VALUE = 11;
/**
*
* A banned function call.
* Unlike BANNED_NAME, this only bans calls to the property, i.e. using the
* property as a value is allowed.
*
*
* BANNED_NAME_CALL = 12;
*/
public static final int BANNED_NAME_CALL_VALUE = 12;
public final int getNumber() {
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Type valueOf(int value) {
return forNumber(value);
}
public static Type forNumber(int value) {
switch (value) {
case 1: return CUSTOM;
case 2: return BANNED_DEPENDENCY;
case 3: return BANNED_NAME;
case 4: return BANNED_PROPERTY;
case 5: return BANNED_PROPERTY_READ;
case 6: return BANNED_PROPERTY_WRITE;
case 7: return RESTRICTED_NAME_CALL;
case 8: return RESTRICTED_METHOD_CALL;
case 9: return BANNED_CODE_PATTERN;
case 10: return BANNED_PROPERTY_CALL;
case 11: return BANNED_PROPERTY_NON_CONSTANT_WRITE;
case 12: return BANNED_NAME_CALL;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
Type> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Type findValueByNumber(int number) {
return Type.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return com.google.javascript.jscomp.Requirement.getDescriptor().getEnumTypes().get(0);
}
private static final Type[] VALUES = values();
public static Type valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int value;
private Type(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:jscomp.Requirement.Type)
}
/**
* Protobuf enum {@code jscomp.Requirement.TypeMatchingStrategy}
*/
public enum TypeMatchingStrategy
implements com.google.protobuf.ProtocolMessageEnum {
/**
* UNKNOWN = 0;
*/
UNKNOWN(0),
/**
*
* Matches type or any subtype. Matches types with different
* nullability/voidability. Allows loose matches.
*
*
* LOOSE = 1;
*/
LOOSE(1),
/**
*
* Matches type or any subtype. Does not match types with different
* nullability/voidability. Allows loose matches.
*
*
* STRICT_NULLABILITY = 2;
*/
STRICT_NULLABILITY(2),
/**
*
* Matches type or any subtype. Does not match types with different
* nullability/voidability. Does not allow loose matches.
*
*
* SUBTYPES = 3;
*/
SUBTYPES(3),
/**
*
* Does not match subtypes. Does not match types with different
* nullability/voidability. Does not allow loose matches.
*
*
* EXACT = 4;
*/
EXACT(4),
;
/**
* UNKNOWN = 0;
*/
public static final int UNKNOWN_VALUE = 0;
/**
*
* Matches type or any subtype. Matches types with different
* nullability/voidability. Allows loose matches.
*
*
* LOOSE = 1;
*/
public static final int LOOSE_VALUE = 1;
/**
*
* Matches type or any subtype. Does not match types with different
* nullability/voidability. Allows loose matches.
*
*
* STRICT_NULLABILITY = 2;
*/
public static final int STRICT_NULLABILITY_VALUE = 2;
/**
*
* Matches type or any subtype. Does not match types with different
* nullability/voidability. Does not allow loose matches.
*
*
* SUBTYPES = 3;
*/
public static final int SUBTYPES_VALUE = 3;
/**
*
* Does not match subtypes. Does not match types with different
* nullability/voidability. Does not allow loose matches.
*
*
* EXACT = 4;
*/
public static final int EXACT_VALUE = 4;
public final int getNumber() {
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static TypeMatchingStrategy valueOf(int value) {
return forNumber(value);
}
public static TypeMatchingStrategy forNumber(int value) {
switch (value) {
case 0: return UNKNOWN;
case 1: return LOOSE;
case 2: return STRICT_NULLABILITY;
case 3: return SUBTYPES;
case 4: return EXACT;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
TypeMatchingStrategy> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public TypeMatchingStrategy findValueByNumber(int number) {
return TypeMatchingStrategy.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return com.google.javascript.jscomp.Requirement.getDescriptor().getEnumTypes().get(1);
}
private static final TypeMatchingStrategy[] VALUES = values();
public static TypeMatchingStrategy valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int value;
private TypeMatchingStrategy(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:jscomp.Requirement.TypeMatchingStrategy)
}
/**
*
* With what severity to report the issue by default.
*
*
* Protobuf enum {@code jscomp.Requirement.Severity}
*/
public enum Severity
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* Currently treated the same as WARNING.
*
*
* UNSPECIFIED = 0;
*/
UNSPECIFIED(0),
/**
*
* Allows the build to continue. Can be turned into an error by setting the
* jscomp_error=conformanceConfig flag.
*
*
* WARNING = 1;
*/
WARNING(1),
/**
*
* The build fails if we are confident this is an error.
* This causes an error even on possible violations, e.g. when the type
* system is ambiguous.
*
*
* ERROR = 2;
*/
ERROR(2),
;
/**
*
* Currently treated the same as WARNING.
*
*
* UNSPECIFIED = 0;
*/
public static final int UNSPECIFIED_VALUE = 0;
/**
*
* Allows the build to continue. Can be turned into an error by setting the
* jscomp_error=conformanceConfig flag.
*
*
* WARNING = 1;
*/
public static final int WARNING_VALUE = 1;
/**
*
* The build fails if we are confident this is an error.
* This causes an error even on possible violations, e.g. when the type
* system is ambiguous.
*
*
* ERROR = 2;
*/
public static final int ERROR_VALUE = 2;
public final int getNumber() {
return value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Severity valueOf(int value) {
return forNumber(value);
}
public static Severity forNumber(int value) {
switch (value) {
case 0: return UNSPECIFIED;
case 1: return WARNING;
case 2: return ERROR;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
Severity> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Severity findValueByNumber(int number) {
return Severity.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return com.google.javascript.jscomp.Requirement.getDescriptor().getEnumTypes().get(2);
}
private static final Severity[] VALUES = values();
public static Severity valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int value;
private Severity(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:jscomp.Requirement.Severity)
}
private int bitField0_;
public static final int ERROR_MESSAGE_FIELD_NUMBER = 1;
private volatile java.lang.Object errorMessage_;
/**
*
* Required: The message to report when a requirement is violated. This should
* reference a document describing the reasoning for the requirement
* and contacts.
*
*
* optional string error_message = 1;
*/
public boolean hasErrorMessage() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
*
* Required: The message to report when a requirement is violated. This should
* reference a document describing the reasoning for the requirement
* and contacts.
*
*
* optional string error_message = 1;
*/
public java.lang.String getErrorMessage() {
java.lang.Object ref = errorMessage_;
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()) {
errorMessage_ = s;
}
return s;
}
}
/**
*
* Required: The message to report when a requirement is violated. This should
* reference a document describing the reasoning for the requirement
* and contacts.
*
*
* optional string error_message = 1;
*/
public com.google.protobuf.ByteString
getErrorMessageBytes() {
java.lang.Object ref = errorMessage_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
errorMessage_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int WHITELIST_FIELD_NUMBER = 2;
private com.google.protobuf.LazyStringList whitelist_;
/**
*
* Optional: A list of source path prefixes that are exempt from the
* requirement.
*
*
* repeated string whitelist = 2;
*/
public com.google.protobuf.ProtocolStringList
getWhitelistList() {
return whitelist_;
}
/**
*
* Optional: A list of source path prefixes that are exempt from the
* requirement.
*
*
* repeated string whitelist = 2;
*/
public int getWhitelistCount() {
return whitelist_.size();
}
/**
*
* Optional: A list of source path prefixes that are exempt from the
* requirement.
*
*
* repeated string whitelist = 2;
*/
public java.lang.String getWhitelist(int index) {
return whitelist_.get(index);
}
/**
*
* Optional: A list of source path prefixes that are exempt from the
* requirement.
*
*
* repeated string whitelist = 2;
*/
public com.google.protobuf.ByteString
getWhitelistBytes(int index) {
return whitelist_.getByteString(index);
}
public static final int WHITELIST_REGEXP_FIELD_NUMBER = 3;
private com.google.protobuf.LazyStringList whitelistRegexp_;
/**
*
* Optional: A list of source paths regexs that are exempt from the
* requirement.
*
*
* repeated string whitelist_regexp = 3;
*/
public com.google.protobuf.ProtocolStringList
getWhitelistRegexpList() {
return whitelistRegexp_;
}
/**
*
* Optional: A list of source paths regexs that are exempt from the
* requirement.
*
*
* repeated string whitelist_regexp = 3;
*/
public int getWhitelistRegexpCount() {
return whitelistRegexp_.size();
}
/**
*
* Optional: A list of source paths regexs that are exempt from the
* requirement.
*
*
* repeated string whitelist_regexp = 3;
*/
public java.lang.String getWhitelistRegexp(int index) {
return whitelistRegexp_.get(index);
}
/**
*
* Optional: A list of source paths regexs that are exempt from the
* requirement.
*
*
* repeated string whitelist_regexp = 3;
*/
public com.google.protobuf.ByteString
getWhitelistRegexpBytes(int index) {
return whitelistRegexp_.getByteString(index);
}
public static final int ONLY_APPLY_TO_FIELD_NUMBER = 4;
private com.google.protobuf.LazyStringList onlyApplyTo_;
/**
*
* Optional: A list of source paths that will be checked for the requirement
* (the opposite of whitelist).
*
*
* repeated string only_apply_to = 4;
*/
public com.google.protobuf.ProtocolStringList
getOnlyApplyToList() {
return onlyApplyTo_;
}
/**
*
* Optional: A list of source paths that will be checked for the requirement
* (the opposite of whitelist).
*
*
* repeated string only_apply_to = 4;
*/
public int getOnlyApplyToCount() {
return onlyApplyTo_.size();
}
/**
*
* Optional: A list of source paths that will be checked for the requirement
* (the opposite of whitelist).
*
*
* repeated string only_apply_to = 4;
*/
public java.lang.String getOnlyApplyTo(int index) {
return onlyApplyTo_.get(index);
}
/**
*
* Optional: A list of source paths that will be checked for the requirement
* (the opposite of whitelist).
*
*
* repeated string only_apply_to = 4;
*/
public com.google.protobuf.ByteString
getOnlyApplyToBytes(int index) {
return onlyApplyTo_.getByteString(index);
}
public static final int ONLY_APPLY_TO_REGEXP_FIELD_NUMBER = 5;
private com.google.protobuf.LazyStringList onlyApplyToRegexp_;
/**
*
* Optional: A list of source path regexps that will be checked for
* the requirement (the opposite of whitelist_regexp).
*
*
* repeated string only_apply_to_regexp = 5;
*/
public com.google.protobuf.ProtocolStringList
getOnlyApplyToRegexpList() {
return onlyApplyToRegexp_;
}
/**
*
* Optional: A list of source path regexps that will be checked for
* the requirement (the opposite of whitelist_regexp).
*
*
* repeated string only_apply_to_regexp = 5;
*/
public int getOnlyApplyToRegexpCount() {
return onlyApplyToRegexp_.size();
}
/**
*
* Optional: A list of source path regexps that will be checked for
* the requirement (the opposite of whitelist_regexp).
*
*
* repeated string only_apply_to_regexp = 5;
*/
public java.lang.String getOnlyApplyToRegexp(int index) {
return onlyApplyToRegexp_.get(index);
}
/**
*
* Optional: A list of source path regexps that will be checked for
* the requirement (the opposite of whitelist_regexp).
*
*
* repeated string only_apply_to_regexp = 5;
*/
public com.google.protobuf.ByteString
getOnlyApplyToRegexpBytes(int index) {
return onlyApplyToRegexp_.getByteString(index);
}
public static final int TYPE_FIELD_NUMBER = 6;
private int type_;
/**
*
* Required: The type of requirement.
*
*
* optional .jscomp.Requirement.Type type = 6;
*/
public boolean hasType() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
/**
*
* Required: The type of requirement.
*
*
* optional .jscomp.Requirement.Type type = 6;
*/
public com.google.javascript.jscomp.Requirement.Type getType() {
com.google.javascript.jscomp.Requirement.Type result = com.google.javascript.jscomp.Requirement.Type.valueOf(type_);
return result == null ? com.google.javascript.jscomp.Requirement.Type.CUSTOM : result;
}
public static final int VALUE_FIELD_NUMBER = 7;
private com.google.protobuf.LazyStringList value_;
/**
*
* The value banned, optional for "custom" requirements.
*
*
* repeated string value = 7;
*/
public com.google.protobuf.ProtocolStringList
getValueList() {
return value_;
}
/**
*
* The value banned, optional for "custom" requirements.
*
*
* repeated string value = 7;
*/
public int getValueCount() {
return value_.size();
}
/**
*
* The value banned, optional for "custom" requirements.
*
*
* repeated string value = 7;
*/
public java.lang.String getValue(int index) {
return value_.get(index);
}
/**
*
* The value banned, optional for "custom" requirements.
*
*
* repeated string value = 7;
*/
public com.google.protobuf.ByteString
getValueBytes(int index) {
return value_.getByteString(index);
}
public static final int TYPE_MATCHING_STRATEGY_FIELD_NUMBER = 13;
private int typeMatchingStrategy_;
/**
*
* Strategy to use for matching types in the value parameter (e.g. for
* BANNED_CODE_PATTERN checks).
*
*
* optional .jscomp.Requirement.TypeMatchingStrategy type_matching_strategy = 13 [default = LOOSE];
*/
public boolean hasTypeMatchingStrategy() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
/**
*
* Strategy to use for matching types in the value parameter (e.g. for
* BANNED_CODE_PATTERN checks).
*
*
* optional .jscomp.Requirement.TypeMatchingStrategy type_matching_strategy = 13 [default = LOOSE];
*/
public com.google.javascript.jscomp.Requirement.TypeMatchingStrategy getTypeMatchingStrategy() {
com.google.javascript.jscomp.Requirement.TypeMatchingStrategy result = com.google.javascript.jscomp.Requirement.TypeMatchingStrategy.valueOf(typeMatchingStrategy_);
return result == null ? com.google.javascript.jscomp.Requirement.TypeMatchingStrategy.LOOSE : result;
}
public static final int JAVA_CLASS_FIELD_NUMBER = 8;
private volatile java.lang.Object javaClass_;
/**
*
* For "custom" requirements, the Java class used to enforce the requirement.
* Ignored otherwise.
*
*
* optional string java_class = 8;
*/
public boolean hasJavaClass() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
/**
*
* For "custom" requirements, the Java class used to enforce the requirement.
* Ignored otherwise.
*
*
* optional string java_class = 8;
*/
public java.lang.String getJavaClass() {
java.lang.Object ref = javaClass_;
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()) {
javaClass_ = s;
}
return s;
}
}
/**
*
* For "custom" requirements, the Java class used to enforce the requirement.
* Ignored otherwise.
*
*
* optional string java_class = 8;
*/
public com.google.protobuf.ByteString
getJavaClassBytes() {
java.lang.Object ref = javaClass_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
javaClass_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int RULE_ID_FIELD_NUMBER = 9;
private volatile java.lang.Object ruleId_;
/**
*
* Gives the rule an unique ID that can be used for extending in other rules
* through 'extends'. An example of ID is 'closure:innerHtml'.
*
*
* optional string rule_id = 9;
*/
public boolean hasRuleId() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
/**
*
* Gives the rule an unique ID that can be used for extending in other rules
* through 'extends'. An example of ID is 'closure:innerHtml'.
*
*
* optional string rule_id = 9;
*/
public java.lang.String getRuleId() {
java.lang.Object ref = ruleId_;
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()) {
ruleId_ = s;
}
return s;
}
}
/**
*
* Gives the rule an unique ID that can be used for extending in other rules
* through 'extends'. An example of ID is 'closure:innerHtml'.
*
*
* optional string rule_id = 9;
*/
public com.google.protobuf.ByteString
getRuleIdBytes() {
java.lang.Object ref = ruleId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
ruleId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int EXTENDS_FIELD_NUMBER = 10;
private volatile java.lang.Object extends_;
/**
*
* Allows extending whitelists of rules with the specified rule_id. If this
* field is specified then all fields except whitelist, whitelist_regexp,
* only_apply_to and only_apply_to_regexp are ignored.
*
*
* optional string extends = 10;
*/
public boolean hasExtends() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
*
* Allows extending whitelists of rules with the specified rule_id. If this
* field is specified then all fields except whitelist, whitelist_regexp,
* only_apply_to and only_apply_to_regexp are ignored.
*
*
* optional string extends = 10;
*/
public java.lang.String getExtends() {
java.lang.Object ref = extends_;
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()) {
extends_ = s;
}
return s;
}
}
/**
*
* Allows extending whitelists of rules with the specified rule_id. If this
* field is specified then all fields except whitelist, whitelist_regexp,
* only_apply_to and only_apply_to_regexp are ignored.
*
*
* optional string extends = 10;
*/
public com.google.protobuf.ByteString
getExtendsBytes() {
java.lang.Object ref = extends_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
extends_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int REPORT_LOOSE_TYPE_VIOLATIONS_FIELD_NUMBER = 11;
private boolean reportLooseTypeViolations_;
/**
*
* Whether to report possible violations when type information is not exact.
* Normally, violations on parent types are reported as possible violations.
* This field allows to ignore them and report only violations on exact types.
* This changes the balance between the false positives and the false
* negatives. With the default value, there might be lots of false positives
* (possible violations) but there shouldn't be any false negatives. Without
* reporting the loose type violations, there will be less false positives but
* there can also be false negatives (an actual violation that is not
* reported).
*
*
* optional bool report_loose_type_violations = 11 [default = true];
*/
public boolean hasReportLooseTypeViolations() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
/**
*
* Whether to report possible violations when type information is not exact.
* Normally, violations on parent types are reported as possible violations.
* This field allows to ignore them and report only violations on exact types.
* This changes the balance between the false positives and the false
* negatives. With the default value, there might be lots of false positives
* (possible violations) but there shouldn't be any false negatives. Without
* reporting the loose type violations, there will be less false positives but
* there can also be false negatives (an actual violation that is not
* reported).
*
*
* optional bool report_loose_type_violations = 11 [default = true];
*/
public boolean getReportLooseTypeViolations() {
return reportLooseTypeViolations_;
}
public static final int SEVERITY_FIELD_NUMBER = 12;
private int severity_;
/**
* optional .jscomp.Requirement.Severity severity = 12 [default = WARNING];
*/
public boolean hasSeverity() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
* optional .jscomp.Requirement.Severity severity = 12 [default = WARNING];
*/
public com.google.javascript.jscomp.Requirement.Severity getSeverity() {
com.google.javascript.jscomp.Requirement.Severity result = com.google.javascript.jscomp.Requirement.Severity.valueOf(severity_);
return result == null ? com.google.javascript.jscomp.Requirement.Severity.WARNING : result;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
if (!extensionsAreInitialized()) {
memoizedIsInitialized = 0;
return false;
}
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
com.google.protobuf.GeneratedMessageV3
.ExtendableMessage.ExtensionWriter
extensionWriter = newExtensionWriter();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, errorMessage_);
}
for (int i = 0; i < whitelist_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, whitelist_.getRaw(i));
}
for (int i = 0; i < whitelistRegexp_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, whitelistRegexp_.getRaw(i));
}
for (int i = 0; i < onlyApplyTo_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, onlyApplyTo_.getRaw(i));
}
for (int i = 0; i < onlyApplyToRegexp_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, onlyApplyToRegexp_.getRaw(i));
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeEnum(6, type_);
}
for (int i = 0; i < value_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 7, value_.getRaw(i));
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 8, javaClass_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 9, ruleId_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 10, extends_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeBool(11, reportLooseTypeViolations_);
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
output.writeEnum(12, severity_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeEnum(13, typeMatchingStrategy_);
}
extensionWriter.writeUntil(536870912, output);
unknownFields.writeTo(output);
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, errorMessage_);
}
{
int dataSize = 0;
for (int i = 0; i < whitelist_.size(); i++) {
dataSize += computeStringSizeNoTag(whitelist_.getRaw(i));
}
size += dataSize;
size += 1 * getWhitelistList().size();
}
{
int dataSize = 0;
for (int i = 0; i < whitelistRegexp_.size(); i++) {
dataSize += computeStringSizeNoTag(whitelistRegexp_.getRaw(i));
}
size += dataSize;
size += 1 * getWhitelistRegexpList().size();
}
{
int dataSize = 0;
for (int i = 0; i < onlyApplyTo_.size(); i++) {
dataSize += computeStringSizeNoTag(onlyApplyTo_.getRaw(i));
}
size += dataSize;
size += 1 * getOnlyApplyToList().size();
}
{
int dataSize = 0;
for (int i = 0; i < onlyApplyToRegexp_.size(); i++) {
dataSize += computeStringSizeNoTag(onlyApplyToRegexp_.getRaw(i));
}
size += dataSize;
size += 1 * getOnlyApplyToRegexpList().size();
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(6, type_);
}
{
int dataSize = 0;
for (int i = 0; i < value_.size(); i++) {
dataSize += computeStringSizeNoTag(value_.getRaw(i));
}
size += dataSize;
size += 1 * getValueList().size();
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, javaClass_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, ruleId_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, extends_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(11, reportLooseTypeViolations_);
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(12, severity_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(13, typeMatchingStrategy_);
}
size += extensionsSerializedSize();
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.javascript.jscomp.Requirement)) {
return super.equals(obj);
}
com.google.javascript.jscomp.Requirement other = (com.google.javascript.jscomp.Requirement) obj;
boolean result = true;
result = result && (hasErrorMessage() == other.hasErrorMessage());
if (hasErrorMessage()) {
result = result && getErrorMessage()
.equals(other.getErrorMessage());
}
result = result && getWhitelistList()
.equals(other.getWhitelistList());
result = result && getWhitelistRegexpList()
.equals(other.getWhitelistRegexpList());
result = result && getOnlyApplyToList()
.equals(other.getOnlyApplyToList());
result = result && getOnlyApplyToRegexpList()
.equals(other.getOnlyApplyToRegexpList());
result = result && (hasType() == other.hasType());
if (hasType()) {
result = result && type_ == other.type_;
}
result = result && getValueList()
.equals(other.getValueList());
result = result && (hasTypeMatchingStrategy() == other.hasTypeMatchingStrategy());
if (hasTypeMatchingStrategy()) {
result = result && typeMatchingStrategy_ == other.typeMatchingStrategy_;
}
result = result && (hasJavaClass() == other.hasJavaClass());
if (hasJavaClass()) {
result = result && getJavaClass()
.equals(other.getJavaClass());
}
result = result && (hasRuleId() == other.hasRuleId());
if (hasRuleId()) {
result = result && getRuleId()
.equals(other.getRuleId());
}
result = result && (hasExtends() == other.hasExtends());
if (hasExtends()) {
result = result && getExtends()
.equals(other.getExtends());
}
result = result && (hasReportLooseTypeViolations() == other.hasReportLooseTypeViolations());
if (hasReportLooseTypeViolations()) {
result = result && (getReportLooseTypeViolations()
== other.getReportLooseTypeViolations());
}
result = result && (hasSeverity() == other.hasSeverity());
if (hasSeverity()) {
result = result && severity_ == other.severity_;
}
result = result && unknownFields.equals(other.unknownFields);
result = result &&
getExtensionFields().equals(other.getExtensionFields());
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptorForType().hashCode();
if (hasErrorMessage()) {
hash = (37 * hash) + ERROR_MESSAGE_FIELD_NUMBER;
hash = (53 * hash) + getErrorMessage().hashCode();
}
if (getWhitelistCount() > 0) {
hash = (37 * hash) + WHITELIST_FIELD_NUMBER;
hash = (53 * hash) + getWhitelistList().hashCode();
}
if (getWhitelistRegexpCount() > 0) {
hash = (37 * hash) + WHITELIST_REGEXP_FIELD_NUMBER;
hash = (53 * hash) + getWhitelistRegexpList().hashCode();
}
if (getOnlyApplyToCount() > 0) {
hash = (37 * hash) + ONLY_APPLY_TO_FIELD_NUMBER;
hash = (53 * hash) + getOnlyApplyToList().hashCode();
}
if (getOnlyApplyToRegexpCount() > 0) {
hash = (37 * hash) + ONLY_APPLY_TO_REGEXP_FIELD_NUMBER;
hash = (53 * hash) + getOnlyApplyToRegexpList().hashCode();
}
if (hasType()) {
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + type_;
}
if (getValueCount() > 0) {
hash = (37 * hash) + VALUE_FIELD_NUMBER;
hash = (53 * hash) + getValueList().hashCode();
}
if (hasTypeMatchingStrategy()) {
hash = (37 * hash) + TYPE_MATCHING_STRATEGY_FIELD_NUMBER;
hash = (53 * hash) + typeMatchingStrategy_;
}
if (hasJavaClass()) {
hash = (37 * hash) + JAVA_CLASS_FIELD_NUMBER;
hash = (53 * hash) + getJavaClass().hashCode();
}
if (hasRuleId()) {
hash = (37 * hash) + RULE_ID_FIELD_NUMBER;
hash = (53 * hash) + getRuleId().hashCode();
}
if (hasExtends()) {
hash = (37 * hash) + EXTENDS_FIELD_NUMBER;
hash = (53 * hash) + getExtends().hashCode();
}
if (hasReportLooseTypeViolations()) {
hash = (37 * hash) + REPORT_LOOSE_TYPE_VIOLATIONS_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getReportLooseTypeViolations());
}
if (hasSeverity()) {
hash = (37 * hash) + SEVERITY_FIELD_NUMBER;
hash = (53 * hash) + severity_;
}
hash = hashFields(hash, getExtensionFields());
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.javascript.jscomp.Requirement parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.javascript.jscomp.Requirement parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.javascript.jscomp.Requirement parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.javascript.jscomp.Requirement parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.javascript.jscomp.Requirement parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.javascript.jscomp.Requirement parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.javascript.jscomp.Requirement parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.javascript.jscomp.Requirement parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.javascript.jscomp.Requirement parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.javascript.jscomp.Requirement parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.javascript.jscomp.Requirement prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* A specification of code requirements
*
*
* Protobuf type {@code jscomp.Requirement}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<
com.google.javascript.jscomp.Requirement, Builder> implements
// @@protoc_insertion_point(builder_implements:jscomp.Requirement)
com.google.javascript.jscomp.RequirementOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.javascript.jscomp.Conformance.internal_static_jscomp_Requirement_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.javascript.jscomp.Conformance.internal_static_jscomp_Requirement_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.javascript.jscomp.Requirement.class, com.google.javascript.jscomp.Requirement.Builder.class);
}
// Construct using com.google.javascript.jscomp.Requirement.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
errorMessage_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
whitelist_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000002);
whitelistRegexp_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000004);
onlyApplyTo_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000008);
onlyApplyToRegexp_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000010);
type_ = 1;
bitField0_ = (bitField0_ & ~0x00000020);
value_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000040);
typeMatchingStrategy_ = 1;
bitField0_ = (bitField0_ & ~0x00000080);
javaClass_ = "";
bitField0_ = (bitField0_ & ~0x00000100);
ruleId_ = "";
bitField0_ = (bitField0_ & ~0x00000200);
extends_ = "";
bitField0_ = (bitField0_ & ~0x00000400);
reportLooseTypeViolations_ = true;
bitField0_ = (bitField0_ & ~0x00000800);
severity_ = 1;
bitField0_ = (bitField0_ & ~0x00001000);
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.javascript.jscomp.Conformance.internal_static_jscomp_Requirement_descriptor;
}
public com.google.javascript.jscomp.Requirement getDefaultInstanceForType() {
return com.google.javascript.jscomp.Requirement.getDefaultInstance();
}
public com.google.javascript.jscomp.Requirement build() {
com.google.javascript.jscomp.Requirement result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.google.javascript.jscomp.Requirement buildPartial() {
com.google.javascript.jscomp.Requirement result = new com.google.javascript.jscomp.Requirement(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.errorMessage_ = errorMessage_;
if (((bitField0_ & 0x00000002) == 0x00000002)) {
whitelist_ = whitelist_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000002);
}
result.whitelist_ = whitelist_;
if (((bitField0_ & 0x00000004) == 0x00000004)) {
whitelistRegexp_ = whitelistRegexp_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000004);
}
result.whitelistRegexp_ = whitelistRegexp_;
if (((bitField0_ & 0x00000008) == 0x00000008)) {
onlyApplyTo_ = onlyApplyTo_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000008);
}
result.onlyApplyTo_ = onlyApplyTo_;
if (((bitField0_ & 0x00000010) == 0x00000010)) {
onlyApplyToRegexp_ = onlyApplyToRegexp_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000010);
}
result.onlyApplyToRegexp_ = onlyApplyToRegexp_;
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000002;
}
result.type_ = type_;
if (((bitField0_ & 0x00000040) == 0x00000040)) {
value_ = value_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00000040);
}
result.value_ = value_;
if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
to_bitField0_ |= 0x00000004;
}
result.typeMatchingStrategy_ = typeMatchingStrategy_;
if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
to_bitField0_ |= 0x00000008;
}
result.javaClass_ = javaClass_;
if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
to_bitField0_ |= 0x00000010;
}
result.ruleId_ = ruleId_;
if (((from_bitField0_ & 0x00000400) == 0x00000400)) {
to_bitField0_ |= 0x00000020;
}
result.extends_ = extends_;
if (((from_bitField0_ & 0x00000800) == 0x00000800)) {
to_bitField0_ |= 0x00000040;
}
result.reportLooseTypeViolations_ = reportLooseTypeViolations_;
if (((from_bitField0_ & 0x00001000) == 0x00001000)) {
to_bitField0_ |= 0x00000080;
}
result.severity_ = severity_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder setExtension(
com.google.protobuf.GeneratedMessage.GeneratedExtension<
com.google.javascript.jscomp.Requirement, Type> extension,
Type value) {
return (Builder) super.setExtension(extension, value);
}
public Builder setExtension(
com.google.protobuf.GeneratedMessage.GeneratedExtension<
com.google.javascript.jscomp.Requirement, java.util.List> extension,
int index, Type value) {
return (Builder) super.setExtension(extension, index, value);
}
public Builder addExtension(
com.google.protobuf.GeneratedMessage.GeneratedExtension<
com.google.javascript.jscomp.Requirement, java.util.List> extension,
Type value) {
return (Builder) super.addExtension(extension, value);
}
public Builder clearExtension(
com.google.protobuf.GeneratedMessage.GeneratedExtension<
com.google.javascript.jscomp.Requirement, ?> extension) {
return (Builder) super.clearExtension(extension);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.javascript.jscomp.Requirement) {
return mergeFrom((com.google.javascript.jscomp.Requirement)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.javascript.jscomp.Requirement other) {
if (other == com.google.javascript.jscomp.Requirement.getDefaultInstance()) return this;
if (other.hasErrorMessage()) {
bitField0_ |= 0x00000001;
errorMessage_ = other.errorMessage_;
onChanged();
}
if (!other.whitelist_.isEmpty()) {
if (whitelist_.isEmpty()) {
whitelist_ = other.whitelist_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureWhitelistIsMutable();
whitelist_.addAll(other.whitelist_);
}
onChanged();
}
if (!other.whitelistRegexp_.isEmpty()) {
if (whitelistRegexp_.isEmpty()) {
whitelistRegexp_ = other.whitelistRegexp_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureWhitelistRegexpIsMutable();
whitelistRegexp_.addAll(other.whitelistRegexp_);
}
onChanged();
}
if (!other.onlyApplyTo_.isEmpty()) {
if (onlyApplyTo_.isEmpty()) {
onlyApplyTo_ = other.onlyApplyTo_;
bitField0_ = (bitField0_ & ~0x00000008);
} else {
ensureOnlyApplyToIsMutable();
onlyApplyTo_.addAll(other.onlyApplyTo_);
}
onChanged();
}
if (!other.onlyApplyToRegexp_.isEmpty()) {
if (onlyApplyToRegexp_.isEmpty()) {
onlyApplyToRegexp_ = other.onlyApplyToRegexp_;
bitField0_ = (bitField0_ & ~0x00000010);
} else {
ensureOnlyApplyToRegexpIsMutable();
onlyApplyToRegexp_.addAll(other.onlyApplyToRegexp_);
}
onChanged();
}
if (other.hasType()) {
setType(other.getType());
}
if (!other.value_.isEmpty()) {
if (value_.isEmpty()) {
value_ = other.value_;
bitField0_ = (bitField0_ & ~0x00000040);
} else {
ensureValueIsMutable();
value_.addAll(other.value_);
}
onChanged();
}
if (other.hasTypeMatchingStrategy()) {
setTypeMatchingStrategy(other.getTypeMatchingStrategy());
}
if (other.hasJavaClass()) {
bitField0_ |= 0x00000100;
javaClass_ = other.javaClass_;
onChanged();
}
if (other.hasRuleId()) {
bitField0_ |= 0x00000200;
ruleId_ = other.ruleId_;
onChanged();
}
if (other.hasExtends()) {
bitField0_ |= 0x00000400;
extends_ = other.extends_;
onChanged();
}
if (other.hasReportLooseTypeViolations()) {
setReportLooseTypeViolations(other.getReportLooseTypeViolations());
}
if (other.hasSeverity()) {
setSeverity(other.getSeverity());
}
this.mergeExtensionFields(other);
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
public final boolean isInitialized() {
if (!extensionsAreInitialized()) {
return false;
}
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.javascript.jscomp.Requirement parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.javascript.jscomp.Requirement) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object errorMessage_ = "";
/**
*
* Required: The message to report when a requirement is violated. This should
* reference a document describing the reasoning for the requirement
* and contacts.
*
*
* optional string error_message = 1;
*/
public boolean hasErrorMessage() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
/**
*
* Required: The message to report when a requirement is violated. This should
* reference a document describing the reasoning for the requirement
* and contacts.
*
*
* optional string error_message = 1;
*/
public java.lang.String getErrorMessage() {
java.lang.Object ref = errorMessage_;
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()) {
errorMessage_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Required: The message to report when a requirement is violated. This should
* reference a document describing the reasoning for the requirement
* and contacts.
*
*
* optional string error_message = 1;
*/
public com.google.protobuf.ByteString
getErrorMessageBytes() {
java.lang.Object ref = errorMessage_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
errorMessage_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Required: The message to report when a requirement is violated. This should
* reference a document describing the reasoning for the requirement
* and contacts.
*
*
* optional string error_message = 1;
*/
public Builder setErrorMessage(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
errorMessage_ = value;
onChanged();
return this;
}
/**
*
* Required: The message to report when a requirement is violated. This should
* reference a document describing the reasoning for the requirement
* and contacts.
*
*
* optional string error_message = 1;
*/
public Builder clearErrorMessage() {
bitField0_ = (bitField0_ & ~0x00000001);
errorMessage_ = getDefaultInstance().getErrorMessage();
onChanged();
return this;
}
/**
*
* Required: The message to report when a requirement is violated. This should
* reference a document describing the reasoning for the requirement
* and contacts.
*
*
* optional string error_message = 1;
*/
public Builder setErrorMessageBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
errorMessage_ = value;
onChanged();
return this;
}
private com.google.protobuf.LazyStringList whitelist_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureWhitelistIsMutable() {
if (!((bitField0_ & 0x00000002) == 0x00000002)) {
whitelist_ = new com.google.protobuf.LazyStringArrayList(whitelist_);
bitField0_ |= 0x00000002;
}
}
/**
*
* Optional: A list of source path prefixes that are exempt from the
* requirement.
*
*
* repeated string whitelist = 2;
*/
public com.google.protobuf.ProtocolStringList
getWhitelistList() {
return whitelist_.getUnmodifiableView();
}
/**
*
* Optional: A list of source path prefixes that are exempt from the
* requirement.
*
*
* repeated string whitelist = 2;
*/
public int getWhitelistCount() {
return whitelist_.size();
}
/**
*
* Optional: A list of source path prefixes that are exempt from the
* requirement.
*
*
* repeated string whitelist = 2;
*/
public java.lang.String getWhitelist(int index) {
return whitelist_.get(index);
}
/**
*
* Optional: A list of source path prefixes that are exempt from the
* requirement.
*
*
* repeated string whitelist = 2;
*/
public com.google.protobuf.ByteString
getWhitelistBytes(int index) {
return whitelist_.getByteString(index);
}
/**
*
* Optional: A list of source path prefixes that are exempt from the
* requirement.
*
*
* repeated string whitelist = 2;
*/
public Builder setWhitelist(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureWhitelistIsMutable();
whitelist_.set(index, value);
onChanged();
return this;
}
/**
*
* Optional: A list of source path prefixes that are exempt from the
* requirement.
*
*
* repeated string whitelist = 2;
*/
public Builder addWhitelist(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureWhitelistIsMutable();
whitelist_.add(value);
onChanged();
return this;
}
/**
*
* Optional: A list of source path prefixes that are exempt from the
* requirement.
*
*
* repeated string whitelist = 2;
*/
public Builder addAllWhitelist(
java.lang.Iterable values) {
ensureWhitelistIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, whitelist_);
onChanged();
return this;
}
/**
*
* Optional: A list of source path prefixes that are exempt from the
* requirement.
*
*
* repeated string whitelist = 2;
*/
public Builder clearWhitelist() {
whitelist_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
*
* Optional: A list of source path prefixes that are exempt from the
* requirement.
*
*
* repeated string whitelist = 2;
*/
public Builder addWhitelistBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureWhitelistIsMutable();
whitelist_.add(value);
onChanged();
return this;
}
private com.google.protobuf.LazyStringList whitelistRegexp_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureWhitelistRegexpIsMutable() {
if (!((bitField0_ & 0x00000004) == 0x00000004)) {
whitelistRegexp_ = new com.google.protobuf.LazyStringArrayList(whitelistRegexp_);
bitField0_ |= 0x00000004;
}
}
/**
*
* Optional: A list of source paths regexs that are exempt from the
* requirement.
*
*
* repeated string whitelist_regexp = 3;
*/
public com.google.protobuf.ProtocolStringList
getWhitelistRegexpList() {
return whitelistRegexp_.getUnmodifiableView();
}
/**
*
* Optional: A list of source paths regexs that are exempt from the
* requirement.
*
*
* repeated string whitelist_regexp = 3;
*/
public int getWhitelistRegexpCount() {
return whitelistRegexp_.size();
}
/**
*
* Optional: A list of source paths regexs that are exempt from the
* requirement.
*
*
* repeated string whitelist_regexp = 3;
*/
public java.lang.String getWhitelistRegexp(int index) {
return whitelistRegexp_.get(index);
}
/**
*
* Optional: A list of source paths regexs that are exempt from the
* requirement.
*
*
* repeated string whitelist_regexp = 3;
*/
public com.google.protobuf.ByteString
getWhitelistRegexpBytes(int index) {
return whitelistRegexp_.getByteString(index);
}
/**
*
* Optional: A list of source paths regexs that are exempt from the
* requirement.
*
*
* repeated string whitelist_regexp = 3;
*/
public Builder setWhitelistRegexp(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureWhitelistRegexpIsMutable();
whitelistRegexp_.set(index, value);
onChanged();
return this;
}
/**
*
* Optional: A list of source paths regexs that are exempt from the
* requirement.
*
*
* repeated string whitelist_regexp = 3;
*/
public Builder addWhitelistRegexp(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureWhitelistRegexpIsMutable();
whitelistRegexp_.add(value);
onChanged();
return this;
}
/**
*
* Optional: A list of source paths regexs that are exempt from the
* requirement.
*
*
* repeated string whitelist_regexp = 3;
*/
public Builder addAllWhitelistRegexp(
java.lang.Iterable values) {
ensureWhitelistRegexpIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, whitelistRegexp_);
onChanged();
return this;
}
/**
*
* Optional: A list of source paths regexs that are exempt from the
* requirement.
*
*
* repeated string whitelist_regexp = 3;
*/
public Builder clearWhitelistRegexp() {
whitelistRegexp_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
return this;
}
/**
*
* Optional: A list of source paths regexs that are exempt from the
* requirement.
*
*
* repeated string whitelist_regexp = 3;
*/
public Builder addWhitelistRegexpBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureWhitelistRegexpIsMutable();
whitelistRegexp_.add(value);
onChanged();
return this;
}
private com.google.protobuf.LazyStringList onlyApplyTo_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureOnlyApplyToIsMutable() {
if (!((bitField0_ & 0x00000008) == 0x00000008)) {
onlyApplyTo_ = new com.google.protobuf.LazyStringArrayList(onlyApplyTo_);
bitField0_ |= 0x00000008;
}
}
/**
*
* Optional: A list of source paths that will be checked for the requirement
* (the opposite of whitelist).
*
*
* repeated string only_apply_to = 4;
*/
public com.google.protobuf.ProtocolStringList
getOnlyApplyToList() {
return onlyApplyTo_.getUnmodifiableView();
}
/**
*
* Optional: A list of source paths that will be checked for the requirement
* (the opposite of whitelist).
*
*
* repeated string only_apply_to = 4;
*/
public int getOnlyApplyToCount() {
return onlyApplyTo_.size();
}
/**
*
* Optional: A list of source paths that will be checked for the requirement
* (the opposite of whitelist).
*
*
* repeated string only_apply_to = 4;
*/
public java.lang.String getOnlyApplyTo(int index) {
return onlyApplyTo_.get(index);
}
/**
*
* Optional: A list of source paths that will be checked for the requirement
* (the opposite of whitelist).
*
*
* repeated string only_apply_to = 4;
*/
public com.google.protobuf.ByteString
getOnlyApplyToBytes(int index) {
return onlyApplyTo_.getByteString(index);
}
/**
*
* Optional: A list of source paths that will be checked for the requirement
* (the opposite of whitelist).
*
*
* repeated string only_apply_to = 4;
*/
public Builder setOnlyApplyTo(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureOnlyApplyToIsMutable();
onlyApplyTo_.set(index, value);
onChanged();
return this;
}
/**
*
* Optional: A list of source paths that will be checked for the requirement
* (the opposite of whitelist).
*
*
* repeated string only_apply_to = 4;
*/
public Builder addOnlyApplyTo(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureOnlyApplyToIsMutable();
onlyApplyTo_.add(value);
onChanged();
return this;
}
/**
*
* Optional: A list of source paths that will be checked for the requirement
* (the opposite of whitelist).
*
*
* repeated string only_apply_to = 4;
*/
public Builder addAllOnlyApplyTo(
java.lang.Iterable values) {
ensureOnlyApplyToIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, onlyApplyTo_);
onChanged();
return this;
}
/**
*
* Optional: A list of source paths that will be checked for the requirement
* (the opposite of whitelist).
*
*
* repeated string only_apply_to = 4;
*/
public Builder clearOnlyApplyTo() {
onlyApplyTo_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
return this;
}
/**
*
* Optional: A list of source paths that will be checked for the requirement
* (the opposite of whitelist).
*
*
* repeated string only_apply_to = 4;
*/
public Builder addOnlyApplyToBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureOnlyApplyToIsMutable();
onlyApplyTo_.add(value);
onChanged();
return this;
}
private com.google.protobuf.LazyStringList onlyApplyToRegexp_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureOnlyApplyToRegexpIsMutable() {
if (!((bitField0_ & 0x00000010) == 0x00000010)) {
onlyApplyToRegexp_ = new com.google.protobuf.LazyStringArrayList(onlyApplyToRegexp_);
bitField0_ |= 0x00000010;
}
}
/**
*
* Optional: A list of source path regexps that will be checked for
* the requirement (the opposite of whitelist_regexp).
*
*
* repeated string only_apply_to_regexp = 5;
*/
public com.google.protobuf.ProtocolStringList
getOnlyApplyToRegexpList() {
return onlyApplyToRegexp_.getUnmodifiableView();
}
/**
*
* Optional: A list of source path regexps that will be checked for
* the requirement (the opposite of whitelist_regexp).
*
*
* repeated string only_apply_to_regexp = 5;
*/
public int getOnlyApplyToRegexpCount() {
return onlyApplyToRegexp_.size();
}
/**
*
* Optional: A list of source path regexps that will be checked for
* the requirement (the opposite of whitelist_regexp).
*
*
* repeated string only_apply_to_regexp = 5;
*/
public java.lang.String getOnlyApplyToRegexp(int index) {
return onlyApplyToRegexp_.get(index);
}
/**
*
* Optional: A list of source path regexps that will be checked for
* the requirement (the opposite of whitelist_regexp).
*
*
* repeated string only_apply_to_regexp = 5;
*/
public com.google.protobuf.ByteString
getOnlyApplyToRegexpBytes(int index) {
return onlyApplyToRegexp_.getByteString(index);
}
/**
*
* Optional: A list of source path regexps that will be checked for
* the requirement (the opposite of whitelist_regexp).
*
*
* repeated string only_apply_to_regexp = 5;
*/
public Builder setOnlyApplyToRegexp(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureOnlyApplyToRegexpIsMutable();
onlyApplyToRegexp_.set(index, value);
onChanged();
return this;
}
/**
*
* Optional: A list of source path regexps that will be checked for
* the requirement (the opposite of whitelist_regexp).
*
*
* repeated string only_apply_to_regexp = 5;
*/
public Builder addOnlyApplyToRegexp(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureOnlyApplyToRegexpIsMutable();
onlyApplyToRegexp_.add(value);
onChanged();
return this;
}
/**
*
* Optional: A list of source path regexps that will be checked for
* the requirement (the opposite of whitelist_regexp).
*
*
* repeated string only_apply_to_regexp = 5;
*/
public Builder addAllOnlyApplyToRegexp(
java.lang.Iterable values) {
ensureOnlyApplyToRegexpIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, onlyApplyToRegexp_);
onChanged();
return this;
}
/**
*
* Optional: A list of source path regexps that will be checked for
* the requirement (the opposite of whitelist_regexp).
*
*
* repeated string only_apply_to_regexp = 5;
*/
public Builder clearOnlyApplyToRegexp() {
onlyApplyToRegexp_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000010);
onChanged();
return this;
}
/**
*
* Optional: A list of source path regexps that will be checked for
* the requirement (the opposite of whitelist_regexp).
*
*
* repeated string only_apply_to_regexp = 5;
*/
public Builder addOnlyApplyToRegexpBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureOnlyApplyToRegexpIsMutable();
onlyApplyToRegexp_.add(value);
onChanged();
return this;
}
private int type_ = 1;
/**
*
* Required: The type of requirement.
*
*
* optional .jscomp.Requirement.Type type = 6;
*/
public boolean hasType() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
/**
*
* Required: The type of requirement.
*
*
* optional .jscomp.Requirement.Type type = 6;
*/
public com.google.javascript.jscomp.Requirement.Type getType() {
com.google.javascript.jscomp.Requirement.Type result = com.google.javascript.jscomp.Requirement.Type.valueOf(type_);
return result == null ? com.google.javascript.jscomp.Requirement.Type.CUSTOM : result;
}
/**
*
* Required: The type of requirement.
*
*
* optional .jscomp.Requirement.Type type = 6;
*/
public Builder setType(com.google.javascript.jscomp.Requirement.Type value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
type_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Required: The type of requirement.
*
*
* optional .jscomp.Requirement.Type type = 6;
*/
public Builder clearType() {
bitField0_ = (bitField0_ & ~0x00000020);
type_ = 1;
onChanged();
return this;
}
private com.google.protobuf.LazyStringList value_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureValueIsMutable() {
if (!((bitField0_ & 0x00000040) == 0x00000040)) {
value_ = new com.google.protobuf.LazyStringArrayList(value_);
bitField0_ |= 0x00000040;
}
}
/**
*
* The value banned, optional for "custom" requirements.
*
*
* repeated string value = 7;
*/
public com.google.protobuf.ProtocolStringList
getValueList() {
return value_.getUnmodifiableView();
}
/**
*
* The value banned, optional for "custom" requirements.
*
*
* repeated string value = 7;
*/
public int getValueCount() {
return value_.size();
}
/**
*
* The value banned, optional for "custom" requirements.
*
*
* repeated string value = 7;
*/
public java.lang.String getValue(int index) {
return value_.get(index);
}
/**
*
* The value banned, optional for "custom" requirements.
*
*
* repeated string value = 7;
*/
public com.google.protobuf.ByteString
getValueBytes(int index) {
return value_.getByteString(index);
}
/**
*
* The value banned, optional for "custom" requirements.
*
*
* repeated string value = 7;
*/
public Builder setValue(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureValueIsMutable();
value_.set(index, value);
onChanged();
return this;
}
/**
*
* The value banned, optional for "custom" requirements.
*
*
* repeated string value = 7;
*/
public Builder addValue(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureValueIsMutable();
value_.add(value);
onChanged();
return this;
}
/**
*
* The value banned, optional for "custom" requirements.
*
*
* repeated string value = 7;
*/
public Builder addAllValue(
java.lang.Iterable values) {
ensureValueIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, value_);
onChanged();
return this;
}
/**
*
* The value banned, optional for "custom" requirements.
*
*
* repeated string value = 7;
*/
public Builder clearValue() {
value_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000040);
onChanged();
return this;
}
/**
*
* The value banned, optional for "custom" requirements.
*
*
* repeated string value = 7;
*/
public Builder addValueBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureValueIsMutable();
value_.add(value);
onChanged();
return this;
}
private int typeMatchingStrategy_ = 1;
/**
*
* Strategy to use for matching types in the value parameter (e.g. for
* BANNED_CODE_PATTERN checks).
*
*
* optional .jscomp.Requirement.TypeMatchingStrategy type_matching_strategy = 13 [default = LOOSE];
*/
public boolean hasTypeMatchingStrategy() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
/**
*
* Strategy to use for matching types in the value parameter (e.g. for
* BANNED_CODE_PATTERN checks).
*
*
* optional .jscomp.Requirement.TypeMatchingStrategy type_matching_strategy = 13 [default = LOOSE];
*/
public com.google.javascript.jscomp.Requirement.TypeMatchingStrategy getTypeMatchingStrategy() {
com.google.javascript.jscomp.Requirement.TypeMatchingStrategy result = com.google.javascript.jscomp.Requirement.TypeMatchingStrategy.valueOf(typeMatchingStrategy_);
return result == null ? com.google.javascript.jscomp.Requirement.TypeMatchingStrategy.LOOSE : result;
}
/**
*
* Strategy to use for matching types in the value parameter (e.g. for
* BANNED_CODE_PATTERN checks).
*
*
* optional .jscomp.Requirement.TypeMatchingStrategy type_matching_strategy = 13 [default = LOOSE];
*/
public Builder setTypeMatchingStrategy(com.google.javascript.jscomp.Requirement.TypeMatchingStrategy value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000080;
typeMatchingStrategy_ = value.getNumber();
onChanged();
return this;
}
/**
*
* Strategy to use for matching types in the value parameter (e.g. for
* BANNED_CODE_PATTERN checks).
*
*
* optional .jscomp.Requirement.TypeMatchingStrategy type_matching_strategy = 13 [default = LOOSE];
*/
public Builder clearTypeMatchingStrategy() {
bitField0_ = (bitField0_ & ~0x00000080);
typeMatchingStrategy_ = 1;
onChanged();
return this;
}
private java.lang.Object javaClass_ = "";
/**
*
* For "custom" requirements, the Java class used to enforce the requirement.
* Ignored otherwise.
*
*
* optional string java_class = 8;
*/
public boolean hasJavaClass() {
return ((bitField0_ & 0x00000100) == 0x00000100);
}
/**
*
* For "custom" requirements, the Java class used to enforce the requirement.
* Ignored otherwise.
*
*
* optional string java_class = 8;
*/
public java.lang.String getJavaClass() {
java.lang.Object ref = javaClass_;
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()) {
javaClass_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* For "custom" requirements, the Java class used to enforce the requirement.
* Ignored otherwise.
*
*
* optional string java_class = 8;
*/
public com.google.protobuf.ByteString
getJavaClassBytes() {
java.lang.Object ref = javaClass_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
javaClass_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* For "custom" requirements, the Java class used to enforce the requirement.
* Ignored otherwise.
*
*
* optional string java_class = 8;
*/
public Builder setJavaClass(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000100;
javaClass_ = value;
onChanged();
return this;
}
/**
*
* For "custom" requirements, the Java class used to enforce the requirement.
* Ignored otherwise.
*
*
* optional string java_class = 8;
*/
public Builder clearJavaClass() {
bitField0_ = (bitField0_ & ~0x00000100);
javaClass_ = getDefaultInstance().getJavaClass();
onChanged();
return this;
}
/**
*
* For "custom" requirements, the Java class used to enforce the requirement.
* Ignored otherwise.
*
*
* optional string java_class = 8;
*/
public Builder setJavaClassBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000100;
javaClass_ = value;
onChanged();
return this;
}
private java.lang.Object ruleId_ = "";
/**
*
* Gives the rule an unique ID that can be used for extending in other rules
* through 'extends'. An example of ID is 'closure:innerHtml'.
*
*
* optional string rule_id = 9;
*/
public boolean hasRuleId() {
return ((bitField0_ & 0x00000200) == 0x00000200);
}
/**
*
* Gives the rule an unique ID that can be used for extending in other rules
* through 'extends'. An example of ID is 'closure:innerHtml'.
*
*
* optional string rule_id = 9;
*/
public java.lang.String getRuleId() {
java.lang.Object ref = ruleId_;
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()) {
ruleId_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Gives the rule an unique ID that can be used for extending in other rules
* through 'extends'. An example of ID is 'closure:innerHtml'.
*
*
* optional string rule_id = 9;
*/
public com.google.protobuf.ByteString
getRuleIdBytes() {
java.lang.Object ref = ruleId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
ruleId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Gives the rule an unique ID that can be used for extending in other rules
* through 'extends'. An example of ID is 'closure:innerHtml'.
*
*
* optional string rule_id = 9;
*/
public Builder setRuleId(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000200;
ruleId_ = value;
onChanged();
return this;
}
/**
*
* Gives the rule an unique ID that can be used for extending in other rules
* through 'extends'. An example of ID is 'closure:innerHtml'.
*
*
* optional string rule_id = 9;
*/
public Builder clearRuleId() {
bitField0_ = (bitField0_ & ~0x00000200);
ruleId_ = getDefaultInstance().getRuleId();
onChanged();
return this;
}
/**
*
* Gives the rule an unique ID that can be used for extending in other rules
* through 'extends'. An example of ID is 'closure:innerHtml'.
*
*
* optional string rule_id = 9;
*/
public Builder setRuleIdBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000200;
ruleId_ = value;
onChanged();
return this;
}
private java.lang.Object extends_ = "";
/**
*
* Allows extending whitelists of rules with the specified rule_id. If this
* field is specified then all fields except whitelist, whitelist_regexp,
* only_apply_to and only_apply_to_regexp are ignored.
*
*
* optional string extends = 10;
*/
public boolean hasExtends() {
return ((bitField0_ & 0x00000400) == 0x00000400);
}
/**
*
* Allows extending whitelists of rules with the specified rule_id. If this
* field is specified then all fields except whitelist, whitelist_regexp,
* only_apply_to and only_apply_to_regexp are ignored.
*
*
* optional string extends = 10;
*/
public java.lang.String getExtends() {
java.lang.Object ref = extends_;
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()) {
extends_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Allows extending whitelists of rules with the specified rule_id. If this
* field is specified then all fields except whitelist, whitelist_regexp,
* only_apply_to and only_apply_to_regexp are ignored.
*
*
* optional string extends = 10;
*/
public com.google.protobuf.ByteString
getExtendsBytes() {
java.lang.Object ref = extends_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
extends_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Allows extending whitelists of rules with the specified rule_id. If this
* field is specified then all fields except whitelist, whitelist_regexp,
* only_apply_to and only_apply_to_regexp are ignored.
*
*
* optional string extends = 10;
*/
public Builder setExtends(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000400;
extends_ = value;
onChanged();
return this;
}
/**
*
* Allows extending whitelists of rules with the specified rule_id. If this
* field is specified then all fields except whitelist, whitelist_regexp,
* only_apply_to and only_apply_to_regexp are ignored.
*
*
* optional string extends = 10;
*/
public Builder clearExtends() {
bitField0_ = (bitField0_ & ~0x00000400);
extends_ = getDefaultInstance().getExtends();
onChanged();
return this;
}
/**
*
* Allows extending whitelists of rules with the specified rule_id. If this
* field is specified then all fields except whitelist, whitelist_regexp,
* only_apply_to and only_apply_to_regexp are ignored.
*
*
* optional string extends = 10;
*/
public Builder setExtendsBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000400;
extends_ = value;
onChanged();
return this;
}
private boolean reportLooseTypeViolations_ = true;
/**
*
* Whether to report possible violations when type information is not exact.
* Normally, violations on parent types are reported as possible violations.
* This field allows to ignore them and report only violations on exact types.
* This changes the balance between the false positives and the false
* negatives. With the default value, there might be lots of false positives
* (possible violations) but there shouldn't be any false negatives. Without
* reporting the loose type violations, there will be less false positives but
* there can also be false negatives (an actual violation that is not
* reported).
*
*
* optional bool report_loose_type_violations = 11 [default = true];
*/
public boolean hasReportLooseTypeViolations() {
return ((bitField0_ & 0x00000800) == 0x00000800);
}
/**
*
* Whether to report possible violations when type information is not exact.
* Normally, violations on parent types are reported as possible violations.
* This field allows to ignore them and report only violations on exact types.
* This changes the balance between the false positives and the false
* negatives. With the default value, there might be lots of false positives
* (possible violations) but there shouldn't be any false negatives. Without
* reporting the loose type violations, there will be less false positives but
* there can also be false negatives (an actual violation that is not
* reported).
*
*
* optional bool report_loose_type_violations = 11 [default = true];
*/
public boolean getReportLooseTypeViolations() {
return reportLooseTypeViolations_;
}
/**
*
* Whether to report possible violations when type information is not exact.
* Normally, violations on parent types are reported as possible violations.
* This field allows to ignore them and report only violations on exact types.
* This changes the balance between the false positives and the false
* negatives. With the default value, there might be lots of false positives
* (possible violations) but there shouldn't be any false negatives. Without
* reporting the loose type violations, there will be less false positives but
* there can also be false negatives (an actual violation that is not
* reported).
*
*
* optional bool report_loose_type_violations = 11 [default = true];
*/
public Builder setReportLooseTypeViolations(boolean value) {
bitField0_ |= 0x00000800;
reportLooseTypeViolations_ = value;
onChanged();
return this;
}
/**
*
* Whether to report possible violations when type information is not exact.
* Normally, violations on parent types are reported as possible violations.
* This field allows to ignore them and report only violations on exact types.
* This changes the balance between the false positives and the false
* negatives. With the default value, there might be lots of false positives
* (possible violations) but there shouldn't be any false negatives. Without
* reporting the loose type violations, there will be less false positives but
* there can also be false negatives (an actual violation that is not
* reported).
*
*
* optional bool report_loose_type_violations = 11 [default = true];
*/
public Builder clearReportLooseTypeViolations() {
bitField0_ = (bitField0_ & ~0x00000800);
reportLooseTypeViolations_ = true;
onChanged();
return this;
}
private int severity_ = 1;
/**
* optional .jscomp.Requirement.Severity severity = 12 [default = WARNING];
*/
public boolean hasSeverity() {
return ((bitField0_ & 0x00001000) == 0x00001000);
}
/**
* optional .jscomp.Requirement.Severity severity = 12 [default = WARNING];
*/
public com.google.javascript.jscomp.Requirement.Severity getSeverity() {
com.google.javascript.jscomp.Requirement.Severity result = com.google.javascript.jscomp.Requirement.Severity.valueOf(severity_);
return result == null ? com.google.javascript.jscomp.Requirement.Severity.WARNING : result;
}
/**
* optional .jscomp.Requirement.Severity severity = 12 [default = WARNING];
*/
public Builder setSeverity(com.google.javascript.jscomp.Requirement.Severity value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00001000;
severity_ = value.getNumber();
onChanged();
return this;
}
/**
* optional .jscomp.Requirement.Severity severity = 12 [default = WARNING];
*/
public Builder clearSeverity() {
bitField0_ = (bitField0_ & ~0x00001000);
severity_ = 1;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:jscomp.Requirement)
}
// @@protoc_insertion_point(class_scope:jscomp.Requirement)
private static final com.google.javascript.jscomp.Requirement DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.javascript.jscomp.Requirement();
}
public static com.google.javascript.jscomp.Requirement getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@java.lang.Deprecated public static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public Requirement parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Requirement(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
public com.google.javascript.jscomp.Requirement getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}