/*
 * Copyright (c) 2008 Kasper Nielsen.
 *
 * 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 cake.internal.inject.boot;

import java.util.Optional;
import java.util.concurrent.atomic.AtomicInteger;

import org.cakeframework.inject.Provides;

import test.util.SupplierGenerator.AbstractSupplier;

/**
 *
 */
public class TestStubs {

    public static class UniqueIntegerProvider {
        static final AtomicInteger i = new AtomicInteger();

        @Provides
        public int getTime() {
            return i.incrementAndGet();
        }
    }

    public static class Ints {
        public static final class FactoryIntPrimitive3 {
            @Provides
            public static int create() {
                return 1234;
            }
        }
    }

    public static class Doubles {

        public static final class InstanceFieldDoublePrimitive {
            public static final double INSTANCE = 123d;
        }

        public static final class InstanceFieldDouble {
            public static final Double INSTANCE = 1235d;
        }

        public static class NeedsOptionalOfDoubleConstructor extends AbstractSupplier<Optional<Double>> {

            public NeedsOptionalOfDoubleConstructor(Optional<Double> d) {
                super(d, U);
            }
        }

        public static final class FactoryDoublePrimitive3 {
            @Provides
            public static double create() {
                return 3D;
            }
        }

        public static final class FactoryDouble3 {
            @Provides
            public static Double create() {
                return 3D;
            }
        }

        public static final class ProvideDoublePrimitive3 {
            @Provides
            public double dd() {
                return 3D;
            }
        }

        public static final class ProvideDouble3 {
            @Provides
            public Double xx() {
                return 3D;
            }
        }
    }
}
