Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
* 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"
* TODO(b/112325992): If namespace.Banned is a goog.module that does not
* call goog.module.declareNamespace, the rule will not match.
*
*
* 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"
*
* 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.
*
* 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.
*
* A restricted call, for example:
* - The unsafe opt_html parameter must not be passed to createNode:
* goog.ui.tree.TreeControl.prototype.createNode:function()
*
* 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.
*
* 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.
*
* 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"
* TODO(b/112325992): If namespace.Banned is a goog.module that does not
* call goog.module.declareNamespace, the rule will not match.
*
*
* 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;
/**
*
* A restricted write to an instance property.
* Example: "Element.prototype.innerHTML:!TrustedHTML|string"
*
*
* RESTRICTED_PROPERTY_WRITE = 13;
*/
public static final int RESTRICTED_PROPERTY_WRITE_VALUE = 13;
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;
case 13: return RESTRICTED_PROPERTY_WRITE;
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.
*
* 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)
}
public interface WhitelistEntryOrBuilder extends
// @@protoc_insertion_point(interface_extends:jscomp.Requirement.WhitelistEntry)
com.google.protobuf.MessageOrBuilder {
/**
* optional .jscomp.Requirement.WhitelistEntry.Reason reason = 1;
*/
boolean hasReason();
/**
* optional .jscomp.Requirement.WhitelistEntry.Reason reason = 1;
*/
com.google.javascript.jscomp.Requirement.WhitelistEntry.Reason getReason();
/**
*
*
* optional string explanation = 4;
*/
public Builder setExplanationBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
explanation_ = value;
onChanged();
return this;
}
private com.google.protobuf.LazyStringList comment_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureCommentIsMutable() {
if (!((bitField0_ & 0x00000010) == 0x00000010)) {
comment_ = new com.google.protobuf.LazyStringArrayList(comment_);
bitField0_ |= 0x00000010;
}
}
/**
* repeated string comment = 5;
*/
public com.google.protobuf.ProtocolStringList
getCommentList() {
return comment_.getUnmodifiableView();
}
/**
* repeated string comment = 5;
*/
public int getCommentCount() {
return comment_.size();
}
/**
* repeated string comment = 5;
*/
public java.lang.String getComment(int index) {
return comment_.get(index);
}
/**
* repeated string comment = 5;
*/
public com.google.protobuf.ByteString
getCommentBytes(int index) {
return comment_.getByteString(index);
}
/**
* repeated string comment = 5;
*/
public Builder setComment(
int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureCommentIsMutable();
comment_.set(index, value);
onChanged();
return this;
}
/**
* repeated string comment = 5;
*/
public Builder addComment(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureCommentIsMutable();
comment_.add(value);
onChanged();
return this;
}
/**
* repeated string comment = 5;
*/
public Builder addAllComment(
java.lang.Iterable values) {
ensureCommentIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, comment_);
onChanged();
return this;
}
/**
* repeated string comment = 5;
*/
public Builder clearComment() {
comment_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000010);
onChanged();
return this;
}
/**
* repeated string comment = 5;
*/
public Builder addCommentBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
ensureCommentIsMutable();
comment_.add(value);
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.WhitelistEntry)
}
// @@protoc_insertion_point(class_scope:jscomp.Requirement.WhitelistEntry)
private static final com.google.javascript.jscomp.Requirement.WhitelistEntry DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.javascript.jscomp.Requirement.WhitelistEntry();
}
public static com.google.javascript.jscomp.Requirement.WhitelistEntry getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@java.lang.Deprecated public static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public WhitelistEntry parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new WhitelistEntry(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.WhitelistEntry getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
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.
*
* Required: The message to report when a requirement is violated. This should
* reference a document describing the reasoning for the requirement
* and contacts.
*
* 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.
*
*
* 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).
*
* 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.
*
* 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.
*
* 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).
*
* 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_);
}
for (int i = 0; i < whitelistEntry_.size(); i++) {
output.writeMessage(14, whitelistEntry_.get(i));
}
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_);
}
for (int i = 0; i < whitelistEntry_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(14, whitelistEntry_.get(i));
}
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 && getWhitelistEntryList()
.equals(other.getWhitelistEntryList());
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 (getWhitelistEntryCount() > 0) {
hash = (37 * hash) + WHITELIST_ENTRY_FIELD_NUMBER;
hash = (53 * hash) + getWhitelistEntryList().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
* NEXT ID: 15
*
* Required: The message to report when a requirement is violated. This should
* reference a document describing the reasoning for the requirement
* and contacts.
*
* Required: The message to report when a requirement is violated. This should
* reference a document describing the reasoning for the requirement
* and contacts.
*
* Required: The message to report when a requirement is violated. This should
* reference a document describing the reasoning for the requirement
* and contacts.
*
* Required: The message to report when a requirement is violated. This should
* reference a document describing the reasoning for the requirement
* and contacts.
*
* Required: The message to report when a requirement is violated. This should
* reference a document describing the reasoning for the requirement
* and contacts.
*
* Required: The message to report when a requirement is violated. This should
* reference a document describing the reasoning for the requirement
* and contacts.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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).
*
* 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).
*
* 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).
*
* 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_ & ~0x00001000);
reportLooseTypeViolations_ = true;
onChanged();
return this;
}
private int severity_ = 1;
/**
* optional .jscomp.Requirement.Severity severity = 12 [default = WARNING];
*/
public boolean hasSeverity() {
return ((bitField0_ & 0x00002000) == 0x00002000);
}
/**
* 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_ |= 0x00002000;
severity_ = value.getNumber();
onChanged();
return this;
}
/**
* optional .jscomp.Requirement.Severity severity = 12 [default = WARNING];
*/
public Builder clearSeverity() {
bitField0_ = (bitField0_ & ~0x00002000);
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;
}
}