Get a trim string from the builder and clear the builder.

@param builder
the builder.
@return a trim string
194960
private static String trim( StringBuilder builder ) {
        String str = builder.toString().trim();
        builder.setLength( 0 );
        return str;
    }
26944
public static SybylAtomTypeMatcher getInstance(IChemObjectBuilder builder) {
        if (!factories.containsKey(builder)) factories.put(builder, new SybylAtomTypeMatcher(builder));
        return factories.get(builder);
    }
1052264
public function apply(Builder $builder)
    {
        $this->builder = $builder;

        foreach ($this->filters() as $name => $value) {
            if (! method_exists($this, $name)) {
                continue;
            }

            if (is_array($value) or trim($value)) {
                $this->$name($value);
            } else {
                $this->$name();
            }
        }

        return $this->builder;
    }
163802
public static GsonBuilder registerInstant(GsonBuilder builder)
  {
    if (builder == null) { throw new NullPointerException("builder cannot be null"); }

    builder.registerTypeAdapter(INSTANT_TYPE, new InstantConverter());

    return builder;
  }
922521
public Datatype.Builder clear() {
    Datatype_Builder defaults = new Datatype.Builder();
    type = defaults.type;
    interfaceType = defaults.interfaceType;
    builder = defaults.builder;
    extensible = defaults.extensible;
    builderFactory = defaults.builderFactory;
    generatedBuilder = defaults.generatedBuilder;
    valueType = defaults.valueType;
    partialType = defaults.partialType;
    rebuildableType = defaults.rebuildableType;
    propertyEnum = defaults.propertyEnum;
    standardMethodUnderrides.clear();
    builderSerializable = defaults.builderSerializable;
    hasToBuilderMethod = defaults.hasToBuilderMethod;
    clearGeneratedBuilderAnnotations();
    clearValueTypeAnnotations();
    valueTypeVisibility = defaults.valueTypeVisibility;
    clearNestedClasses();
    _unsetProperties.clear();
    _unsetProperties.addAll(defaults._unsetProperties);
    return (Datatype.Builder) this;
  }
1043918
protected function addOnlyTrashed(Builder $builder)
	{
		$builder->macro('onlyTrashed', function(Builder $builder)
		{
			$model = $builder->getModel();

			$this->remove($builder, $model);

			$builder->getQuery()->whereNotNull($model->getQualifiedDeletedAtColumn());

			return $builder;
		});
	}
869827
public function remove(Builder $builder)
    {
        $column = $builder->getModel()->getQualifiedDeletedAtColumn();

        $query = $builder->getQuery();

        foreach ((array) $query->wheres as $key => $where) {
            if ($this->isSoftDeleteConstraint($where, $column)) {
                unset($query->wheres[$key]);

                $query->wheres = array_values($query->wheres);
            }
        }
    }
185332
@Nonnull
	public static <T> LTieCharFunction<T> tieCharFunctionFrom(Consumer<LTieCharFunctionBuilder<T>> buildingFunction) {
		LTieCharFunctionBuilder builder = new LTieCharFunctionBuilder();
		buildingFunction.accept(builder);
		return builder.build();
	}
52047
@Override
    protected BaseDialogFragment.Builder build(BaseDialogFragment.Builder builder) {
        final CharSequence title = getTitle();
        if (!TextUtils.isEmpty(title)) {
            builder.setTitle(title);
        }

        final CharSequence message = getMessage();
        if (!TextUtils.isEmpty(message)) {
            builder.setMessage(message);
        }

        final CharSequence positiveButtonText = getPositiveButtonText();
        if (!TextUtils.isEmpty(positiveButtonText)) {
            builder.setPositiveButton(positiveButtonText, new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    for (IPositiveButtonDialogListener listener : getPositiveButtonDialogListeners()) {
                        listener.onPositiveButtonClicked(mRequestCode);
                    }
                    dismiss();
                }
            });
        }

        final CharSequence negativeButtonText = getNegativeButtonText();
        if (!TextUtils.isEmpty(negativeButtonText)) {
            builder.setNegativeButton(negativeButtonText, new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    for (INegativeButtonDialogListener listener : getNegativeButtonDialogListeners()) {
                        listener.onNegativeButtonClicked(mRequestCode);
                    }
                    dismiss();
                }
            });
        }

        final CharSequence neutralButtonText = getNeutralButtonText();
        if (!TextUtils.isEmpty(neutralButtonText)) {
            builder.setNeutralButton(neutralButtonText, new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    for (INeutralButtonDialogListener listener : getNeutralButtonDialogListeners()) {
                        listener.onNeutralButtonClicked(mRequestCode);
                    }
                    dismiss();
                }
            });
        }

        return builder;
    }
666152
public JcString trimRight() {
		JcString ret = new JcString(null, this,
				new FunctionInstance(FUNCTION.String.RTRIM, 1));
		QueryRecorder.recordInvocationConditional(this, "trimRight", ret);
		return ret;
	}
274339
@NullSafe
  public static String trim(String value) {
    return value != null ? value.trim() : null;
  }
1211366
public static DesiredCapabilities retrieveCustomCapabilities(Class<? extends DefaultCapabilitiesBuilder> builder) {
        logger.entering(builder);

        DesiredCapabilities caps = new DesiredCapabilities();
        if (builder != null && !builder.getName().equals(DefaultCapabilitiesBuilder.class.getName())) {
            try {
                caps = builder.newInstance().createCapabilities();
            } catch (InstantiationException | IllegalAccessException e) {
                throw new IllegalStateException("Unable to apply desired capabilities from " + builder.getName(), e);
            }
        }

        logger.exiting(caps);
        return caps;
    }
1263949
private static String getStringFromInputStream(InputStream inputStream, boolean trim) throws IOException {
    BufferedReader bufferedReader = null;
    StringBuilder stringBuilder = new StringBuilder();
    try {
      bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
      String line;
      while ((line = bufferedReader.readLine()) != null) {
        if (trim) {
          stringBuilder.append(line.trim());
        }
        else {
          stringBuilder.append(line).append("\n");
        }
      }
    }
    finally {
      closeSilently(bufferedReader);
    }

    return stringBuilder.toString();
  }
553227
public static String trim(String s, int maxWidth) {
    if (s.length() <= maxWidth) {
      return (s);
    }
    return (s.substring(0, maxWidth));
  }
603796
def _get_deleted_at_column(self, builder):
        
        if len(builder.get_query().joins) > 0:
            return builder.get_model().get_qualified_deleted_at_column()
        else:
            return builder.get_model().get_deleted_at_column()
1086021
protected org.apache.http.impl.client.HttpClientBuilder customizeBuilder(
        org.apache.http.impl.client.HttpClientBuilder builder
    ) {
        return builder;
    }
225552
@SuppressWarnings("unchecked")
  public SingleFieldBuilder<MType, BType, IType> clear() {
    message = (MType) (message != null ?
        message.getDefaultInstanceForType() :
        builder.getDefaultInstanceForType());
    if (builder != null) {
      builder.dispose();
      builder = null;
    }
    onChanged();
    return this;
  }