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

com.shapesecurity.shift.ast.BindingWithDefault Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
// Generated by src/generate-spec-java.js 

/*
 * Copyright 2015 Shape Security, Inc.
 *
 * 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.shapesecurity.shift.ast;

import com.shapesecurity.functional.data.HashCodeBuilder;

import org.jetbrains.annotations.NotNull;

public class BindingWithDefault implements Node, BindingBindingWithDefault {

    @NotNull
    public final Binding binding;

    @NotNull
    public final Expression init;

    public BindingWithDefault(@NotNull Binding binding, @NotNull Expression init) {
        super();
        this.binding = binding;
        this.init = init;
    }

    @Override
    public boolean equals(Object object) {
        return object instanceof BindingWithDefault && this.binding.equals(((BindingWithDefault) object).binding) &&
               this.init.equals(((BindingWithDefault) object).init);
    }

    @Override
    public int hashCode() {
        int code = HashCodeBuilder.put(0, "BindingWithDefault");
        code = HashCodeBuilder.put(code, this.binding);
        code = HashCodeBuilder.put(code, this.init);
        return code;
    }

    @NotNull
    public Binding getBinding() {
        return this.binding;
    }

    @NotNull
    public BindingWithDefault setBinding(@NotNull Binding binding) {
        return new BindingWithDefault(binding, this.init);
    }

    @NotNull
    public Expression getInit() {
        return this.init;
    }

    @NotNull
    public BindingWithDefault setInit(@NotNull Expression init) {
        return new BindingWithDefault(this.binding, init);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy