All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bendb.thrifty.schema.parser.ThriftFileElement Maven / Gradle / Ivy

There is a newer version: 3.1.0
Show newest version
/*
 * Copyright (C) 2015-2016 Benjamin Bader
 *
 * Licensed 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 com.bendb.thrifty.schema.parser;

import com.bendb.thrifty.schema.Location;
import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;

@AutoValue
public abstract class ThriftFileElement {
    public abstract Location location();
    public abstract ImmutableList namespaces();
    public abstract ImmutableList includes();
    public abstract ImmutableList constants();
    public abstract ImmutableList typedefs();
    public abstract ImmutableList enums();
    public abstract ImmutableList structs();
    public abstract ImmutableList unions();
    public abstract ImmutableList exceptions();
    public abstract ImmutableList services();

    public static Builder builder(Location location) {
        return new AutoValue_ThriftFileElement.Builder()
                .location(location)
                .namespaces(ImmutableList.of())
                .includes(ImmutableList.of())
                .constants(ImmutableList.of())
                .typedefs(ImmutableList.of())
                .enums(ImmutableList.of())
                .structs(ImmutableList.of())
                .unions(ImmutableList.of())
                .exceptions(ImmutableList.of())
                .services(ImmutableList.of());
    }

    ThriftFileElement() { }

    @AutoValue.Builder
    public interface Builder {
        Builder location(Location location);
        Builder namespaces(ImmutableList namespaces);
        Builder includes(ImmutableList includes);
        Builder constants(ImmutableList constants);
        Builder typedefs(ImmutableList typedefs);
        Builder enums(ImmutableList enums);
        Builder structs(ImmutableList structs);
        Builder unions(ImmutableList unions);
        Builder exceptions(ImmutableList exceptions);
        Builder services(ImmutableList services);

        ThriftFileElement build();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy