class NodeGatewayMetaState extends BaseNodeResponse {

        @Nullable
        private final Metadata metadata;

        public NodeGatewayMetaState(DiscoveryNode node, Metadata metadata) {
            super(node);
            this.metadata = metadata;
        }

        public NodeGatewayMetaState(StreamInput in) throws IOException {
            super(in);
            if (in.readBoolean()) {
                metadata = Metadata.readFrom(in);
            } else {
                metadata = null;
            }
        }

        @Override
        public void writeTo(StreamOutput out) throws IOException {<FILL_FUNCTION_BODY>}

        @Nullable
        public Metadata metadata() {
            return metadata;
        }
    }

            super.writeTo(out);
            if (metadata == null) {
                out.writeBoolean(false);
            } else {
                out.writeBoolean(true);
                metadata.writeTo(out);
            }
        
<methods><variables>protected final non-sealed org.elasticsearch.cluster.service.ClusterService clusterService,protected final non-sealed Class<org.elasticsearch.gateway.TransportNodesListGatewayMetaState.NodeGatewayMetaState> nodeResponseClass,protected final non-sealed org.elasticsearch.threadpool.ThreadPool threadPool,final non-sealed java.lang.String transportNodeAction,protected final non-sealed org.elasticsearch.transport.TransportService transportService