001/*
002 *  Licensed to the Apache Software Foundation (ASF) under one
003 *  or more contributor license agreements.  See the NOTICE file
004 *  distributed with this work for additional information
005 *  regarding copyright ownership.  The ASF licenses this file
006 *  to you under the Apache License, Version 2.0 (the
007 *  "License"); you may not use this file except in compliance
008 *  with the License.  You may obtain a copy of the License at
009 *
010 *        http://www.apache.org/licenses/LICENSE-2.0
011 *
012 *  Unless required by applicable law or agreed to in writing,
013 *  software distributed under the License is distributed on an
014 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *  KIND, either express or implied.  See the License for the
016 *  specific language governing permissions and limitations
017 *  under the License.
018 */
019package org.apache.isis.core.commons.debug;
020
021public class DebugTee implements DebugBuilder {
022
023    private final DebugBuilder builder1;
024    private final DebugBuilder builder2;
025
026    public DebugTee(final DebugBuilder builder1, final DebugBuilder builder2) {
027        this.builder1 = builder1;
028        this.builder2 = builder2;
029    }
030
031    @Override
032    public void concat(final DebugBuilder debug) {
033        builder1.concat(debug);
034        builder2.concat(debug);
035    }
036
037    @Override
038    public void append(final int number, final int width) {
039        builder1.append(number, width);
040        builder2.append(number, width);
041    }
042
043    @Override
044    public void append(final Object object) {
045        builder1.append(object);
046        builder2.append(object);
047    }
048
049    @Override
050    public void append(final Object object, final int width) {
051        builder1.append(object, width);
052        builder2.append(object, width);
053    }
054
055    @Override
056    public void appendAsHexln(final String label, final long value) {
057        builder1.appendAsHexln(label, value);
058        builder2.appendAsHexln(label, value);
059    }
060
061    @Override
062    public void appendException(final Throwable e) {
063        builder1.appendException(e);
064        builder2.appendException(e);
065    }
066
067    @Override
068    public void appendln() {
069        builder1.appendln();
070        builder2.appendln();
071    }
072
073    @Override
074    public void appendPreformatted(final String text) {
075        builder1.appendPreformatted(text);
076        builder2.appendPreformatted(text);
077    }
078
079    @Override
080    public void appendln(final String text) {
081        builder1.appendln(text);
082        builder2.appendln(text);
083    }
084
085    @Override
086    public void appendln(final String label, final boolean value) {
087        builder1.appendln(label, value);
088        builder2.appendln(label, value);
089    }
090
091    @Override
092    public void appendln(final String label, final double value) {
093        builder1.appendln(label, value);
094        builder2.appendln(label, value);
095    }
096
097    @Override
098    public void appendln(final String label, final long value) {
099        builder1.appendln(label, value);
100        builder2.appendln(label, value);
101    }
102
103    @Override
104    public void appendPreformatted(final String label, final String text) {
105        builder1.appendPreformatted(label, text);
106        builder2.appendPreformatted(label, text);
107    }
108
109    @Override
110    public void appendln(final String label, final Object object) {
111        builder1.appendln(label, object);
112        builder2.appendln(label, object);
113    }
114
115    @Override
116    public void appendln(final String label, final Object[] objects) {
117        builder1.appendln(label, objects);
118        builder2.appendln(label, objects);
119    }
120
121    @Override
122    public void appendTitle(final String title) {
123        builder1.appendTitle(title);
124        builder2.appendTitle(title);
125    }
126
127    @Override
128    public void startSection(final String title) {
129        builder1.startSection(title);
130        builder2.startSection(title);
131    }
132
133    @Override
134    public void endSection() {
135        builder1.endSection();
136        builder2.endSection();
137    }
138
139    @Override
140    public void blankLine() {
141        builder1.blankLine();
142        builder2.blankLine();
143    }
144
145    @Override
146    public void indent() {
147        builder1.indent();
148        builder2.indent();
149    }
150
151    @Override
152    public void unindent() {
153        builder1.unindent();
154        builder2.unindent();
155    }
156
157    @Override
158    public void close() {
159        builder1.close();
160        builder2.close();
161    }
162}