001/**
002 * Copyright (C) 2006-2025 Talend Inc. - www.talend.com
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.talend.sdk.component.runtime.record.json;
017
018import java.io.Writer;
019
020import org.talend.sdk.component.api.record.Record;
021
022import lombok.Getter;
023import lombok.Setter;
024
025public class OutputRecordHolder extends Writer {
026
027    @Getter
028    @Setter
029    private Record record;
030
031    @Getter
032    @Setter
033    private Object data;
034
035    public OutputRecordHolder(final Object data) {
036        this.data = data;
037    }
038
039    public OutputRecordHolder() {
040    }
041
042    @Override
043    public void write(final char[] cbuf, final int off, final int len) {
044        if (len == 0) {
045            return;
046        }
047        throw new UnsupportedOperationException();
048    }
049
050    @Override
051    public void flush() {
052        // no-op
053    }
054
055    @Override
056    public void close() {
057        flush();
058    }
059}