You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2016/02/24 00:21:11 UTC
[23/50] logging-log4j2 git commit: LOG4J2-1293
StringBuilderFormattable initial version
LOG4J2-1293 StringBuilderFormattable initial version
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/a2c9ba8e
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a2c9ba8e
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a2c9ba8e
Branch: refs/heads/LOG4J2-1278-gc-free-logger
Commit: a2c9ba8e2c859094df4d91b894302179e723f198
Parents: 7ff4c96
Author: rpopma <rp...@apache.org>
Authored: Mon Feb 22 14:58:08 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Mon Feb 22 14:58:08 2016 +0900
----------------------------------------------------------------------
.../log4j/util/StringBuilderFormattable.java | 33 ++++++++++++++++++++
1 file changed, 33 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a2c9ba8e/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilderFormattable.java
----------------------------------------------------------------------
diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilderFormattable.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilderFormattable.java
new file mode 100644
index 0000000..5da9b61
--- /dev/null
+++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/StringBuilderFormattable.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.logging.log4j.util;
+
+/**
+ * Objects that implement this interface can be converted to text without allocating temporary objects.
+ *
+ * @since 2.6s
+ */
+public interface StringBuilderFormattable {
+
+ /**
+ * Writes a text representation of this object into the specified {@code StringBuilder}, ideally without allocating
+ * temporary objects.
+ *
+ * @param buffer the StringBuilder to write into
+ */
+ void formatTo(StringBuilder buffer);
+}