Add a modifier.
@param modifier the modifier to add.
504719
public void addModifier(String modifier) {
		if (!Strings.isEmpty(modifier)) {
			getSarlField().getModifiers().add(modifier);
		}
	}
566759
public void addModifier(String modifier) {
		if (!Strings.isEmpty(modifier)) {
			this.sarlCapacity.getModifiers().add(modifier);
		}
	}
1295102
private function removeModifier($modifier)
    {
        if ($this->hasModifier($modifier)) {
            $this->modifiers = str_replace($modifier, '', $this->modifiers);
        }

        return $this;
    }
549403
public FindOptions modifier(final String key, final Object value) {
        options.getModifiers().put(key, value);
        return this;
    }
211885
public static boolean hasModifier(Method method, ModifierType... modifierTypes) {
		if (null == method || ArrayUtil.isEmpty(modifierTypes)) {
			return false;
		}
		return 0 != (method.getModifiers() & modifiersToInt(modifierTypes));
	}
914246
public MethodInfo addMethod(Modifiers modifiers,
                                String methodName,
                                TypeDesc ret,
                                TypeDesc... params) {
        return addMethod(modifiers, methodName, null, ret, params);
    }
279763
public void keyPress(String key, List<ModifierPressed> modifiers) {
    systemInputManager.keyPress(key, modifiers);
  }
1344112
public void keyUp(String key, List<ModifierPressed> modifiers) {
    systemInputManager.keyUp(key, modifiers);
  }
404413
public function addMethod(string $name, string $modifier = "public", bool $static = false) : Method
    {
        $method = new Method($this, $name, $modifier, $static);
        return $this->addMethodObject($method);
    }
284382
private void addHashCodeMethod() {
        Modifiers modifiers = Modifiers.PUBLIC.toSynchronized(true);
        MethodInfo mi = addMethodIfNotFinal(modifiers, "hashCode", TypeDesc.INT, null);

        if (mi == null) {
            return;
        }

        CodeBuilder b = new CodeBuilder(mi);

        boolean mixIn = false;
        for (StorableProperty property : mAllProperties.values()) {
            if (property.isDerived() || property.isJoin()) {
                continue;
            }
            TypeDesc fieldType = TypeDesc.forClass(property.getType());
            b.loadThis();
            b.loadField(property.getName(), fieldType);
            CodeBuilderUtil.addValueHashCodeCall(b, fieldType, true, mixIn);
            mixIn = true;
        }

        b.returnValue(TypeDesc.INT);
    }
603707
private void preprocess_ModifyShapeMembers(ServiceModel serviceModel, Shape shape, ShapeModifier modifier) {

        if (modifier.getModify() != null) {
            for (Map<String, ShapeModifier_ModifyModel> modifies : modifier.getModify()) {
                for (Entry<String, ShapeModifier_ModifyModel> entry : modifies.entrySet()) {

                    String memberToModify = entry.getKey();
                    ShapeModifier_ModifyModel modifyModel = entry.getValue();

                    doModifyShapeMembers(serviceModel, shape, memberToModify, modifyModel);
                }
            }
        }

        if (modifier.getExclude() != null) {
            for (String memberToExclude : modifier.getExclude()) {

                if (shape.getRequired() != null &&
                    shape.getRequired().contains(memberToExclude)) {
                    throw new IllegalStateException(
                            "ShapeModifier.exclude customization found for "
                                    + memberToExclude
                                    + ", but this member is marked as required in the model!");
                }

                if (shape.getMembers() != null) {
                    shape.getMembers().remove(memberToExclude);
                }
            }
        }

        if (modifier.getInject() != null) {
            for (Map<String, Member> injects : modifier.getInject()) {
                if (shape.getMembers() == null) {
                    shape.setMembers(new HashMap<>());
                }
                shape.getMembers().putAll(injects);
            }
        }

        if (modifier.getInjectEnumValues() != null) {
            if (shape.getEnumValues() == null) {
                throw new IllegalStateException("Attempted to add enum members to a non-enum shape!");
            }
            Set<String> extendValues = new HashSet<>(shape.getEnumValues());
            extendValues.addAll(modifier.getInjectEnumValues());
            shape.setEnumValues(new ArrayList<>(extendValues));
        }
    }
74129
public static Optional<SuggestedFix> removeModifiers(
      Tree tree, VisitorState state, Modifier... modifiers) {
    Set<Modifier> toRemove = ImmutableSet.copyOf(modifiers);
    ModifiersTree originalModifiers = getModifiers(tree);
    if (originalModifiers == null) {
      return Optional.empty();
    }
    return removeModifiers(originalModifiers, state, toRemove);
  }
805144
@Requires("modifier != null")
  @Ensures("!getModifiers().contains(modifier)")
  public void removeModifier(ElementModifier modifier) {
    modifiers.remove(modifier);
    switch (modifier) {
      case PRIVATE:
      case PACKAGE_PRIVATE:
      case PROTECTED:
      case PUBLIC:
        modifiers.add(ElementModifier.PACKAGE_PRIVATE);
    }
  }
1336179
public static Predicate<Field> hasModifiers(final Integer modifiers) {
        return field -> (modifiers & field.getModifiers()) == modifiers;
    }
1072436
public static Optional<SuggestedFix> addModifiers(
      Tree tree, ModifiersTree originalModifiers, VisitorState state, Set<Modifier> modifiers) {
    Set<Modifier> toAdd = Sets.difference(modifiers, originalModifiers.getFlags());
    SuggestedFix.Builder fix = SuggestedFix.builder();
    List<Modifier> modifiersToWrite = new ArrayList<>();
    if (!originalModifiers.getFlags().isEmpty()) {
      // a map from modifiers to modifier position (or -1 if the modifier is being added)
      // modifiers are sorted in Google Java Style order
      Map<Modifier, Integer> modifierPositions = new TreeMap<>();
      for (Modifier mod : toAdd) {
        modifierPositions.put(mod, -1);
      }
      List<ErrorProneToken> tokens = state.getTokensForNode(originalModifiers);
      int base = ((JCTree) originalModifiers).getStartPosition();
      for (ErrorProneToken tok : tokens) {
        Modifier mod = getTokModifierKind(tok);
        if (mod != null) {
          modifierPositions.put(mod, base + tok.pos());
        }
      }
      // walk the map of all modifiers, and accumulate a list of new modifiers to insert
      // beside an existing modifier
      for (Modifier mod : modifierPositions.keySet()) {
        int p = modifierPositions.get(mod);
        if (p == -1) {
          modifiersToWrite.add(mod);
        } else if (!modifiersToWrite.isEmpty()) {
          fix.replace(p, p, Joiner.on(' ').join(modifiersToWrite) + " ");
          modifiersToWrite.clear();
        }
      }
    } else {
      modifiersToWrite.addAll(toAdd);
    }
    addRemainingModifiers(tree, state, originalModifiers, modifiersToWrite, fix);
    return Optional.of(fix.build());
  }
337643
public MethodInfo addConstructor(Modifiers modifiers,
                                     TypeDesc[] params) {
        MethodDesc md = MethodDesc.forArguments(null, params);
        MethodInfo mi = new MethodInfo(this, modifiers, "<init>", md);
        mMethods.add(mi);
        return mi;
    }
246613
public void addModifier(String modifier) {
		if (!Strings.isEmpty(modifier)) {
			this.sarlAnnotationType.getModifiers().add(modifier);
		}
	}