Variant of add that takes a string instead of a JsonElement. The inherited add only supports JsonElement.

@param s
element
978999
@Override
    public boolean add(final String s) {
        JsonPrimitive primitive = primitive(s);
        if (!contains(primitive)) {
            return add(primitive);
        } else {
            return false;
        }
    }
459062
protected boolean addElem(final T element) {
    // validate element
    if (element == null) {
      throw new IllegalArgumentException("Null element is not supported.");
    }
    // find hashCode & index
    final int hashCode = element.hashCode();
    final int index = getIndex(hashCode);
    // return false if already present
    if (containsElem(index, element, hashCode)) {
      return false;
    }

    modification++;
    size++;

    // update bucket linked list
    DoubleLinkedElement<T> le = new DoubleLinkedElement<T>(element, hashCode);
    le.next = entries[index];
    entries[index] = le;

    // insert to the end of the all-element linked list
    le.after = null;
    le.before = tail;
    if (tail != null) {
      tail.after = le;
    }
    tail = le;
    if (head == null) {
      head = le;
    }
    return true;
  }
326529
@Override
	public void add(long value, T element) {
		if (root == null) {
			root = new Node<T>(value, element, false);
			first = last = root;
			return;
		}
		root = add(value, element, root);
		root.red = false;
	}
1074388
public synchronized void addElement(@NonNull T element) {
        hashCached = false;
        this.elementsMap.put(element.getLabel(), element);
        this.elements.add(element);
    }
1338471
public void addHeader(String s) throws IOException
    {
        Integer h=(Integer)__headerMap.get(s);
        if (h!=null)
            addInt(h.intValue());
        else
            addString(s);
    }
829355
public void add(InputSplit s) throws IOException {
    if (null == splits) {
      throw new IOException("Uninitialized InputSplit");
    }
    if (fill == splits.length) {
      throw new IOException("Too many splits");
    }
    splits[fill++] = s;
    totsize += s.getLength();
  }
661289
public static ContentType parse(
            final String s) throws ParseException, UnsupportedCharsetException {
        if (s == null) {
            throw new IllegalArgumentException("Content type may not be null");
        }
        HeaderElement[] elements = BasicHeaderValueParser.parseElements(s, null);
        if (elements.length > 0) {
            return create(elements[0]);
        } else {
            throw new ParseException("Invalid content type: " + s);
        }
    }
1310739
public void addElement(ObjectProperty element) {
        assertNotNull(element);
        if (elements == null) {
            elements = new ArrayList<ObjectProperty>();
        }
        elements.add(element);
        element.setParent(this);
    }
578484
private static int add(int set[], StringBuffer str)
    {
        int result = str.length();

        for (int i = result - 1; i >= 0; i --) {
            add(set, str.charAt(i));
        }
        return result;
    }
82937
@Override
    public void add(int index, E element) {
        final ReentrantLock lock = this.lock;
        lock.lock();
        try {
            Object[] elements = getArray();
            int len = elements.length;
            if (index > len || index < 0)
                throw new IndexOutOfBoundsException("Index: " + index +
                                                    ", Size: " + len);
            Object[] newElements;
            int numMoved = len - index;
            if (numMoved == 0)
                newElements = Arrays.copyOf(elements, len + 1);
            else {
                newElements = new Object[len + 1];
                System.arraycopy(elements, 0, newElements, 0, index);
                System.arraycopy(elements, index, newElements, index + 1,
                                 numMoved);
            }
            newElements[index] = element;
            setArray(newElements);
        } finally {
            lock.unlock();
        }
    }
143930
@Override
  public void addElement(Map<String, Object> e, Map<String, AggregatorFactory> a)
  {
    // since we return a constant, no need to read from the event
  }
976672
public void encodeString(final String s) throws IOException {
		final int lenChars = s.length();
		final int lenCharacters = s.codePointCount(0, lenChars);
		encodeUnsignedInteger(lenCharacters);
		encodeStringOnly(s);
	}
813724
public void addString(String str)
    {
        if (sourceNode != null)
        {
            addStringInternal(str);
            replaceOrRegister(sourceNode, str);
        }
        else
        {
            unSimplify();
            addString(str);
        }
    }
1258405
public void addString(String str) {
        if (mSize == mStrings.length) {
            String[] old = mStrings;
            int oldSize = old.length;
            mStrings = new String[oldSize + (oldSize << 1)];
            System.arraycopy(old, 0, mStrings, 0, oldSize);
        }
        mStrings[mSize++] = str;
    }
141185
public void add(String str) {
	curr.next = new Entry(str, Entry.NUL);
	curr = curr.next;
	count++;
    }
577869
@Override
	public boolean add(T newElement) {
		elements[lastIndex] = newElement;
		lastIndex = incrementIndex(lastIndex, 0);
		if (isEmpty()) {
			// First element
			firstIndex = 0;
			size = 1;
		} else if (isFull()) {
			// Reuse space
			firstIndex = lastIndex;
		} else {
			size = incrementIndex(size, elements.length);
		}
		return true;
	}
64829
@Override
  public void add(T indexElement) {
    mapByNum.put(indexElement.getNumber(), indexElement);
    if (mapByRawNum != null) {
      mapByRawNum.put(indexElement.getRawNumber(), indexElement);
    }
    if (mapById != null) {
      mapById.put(indexElement.getId(), indexElement);
    }
  }