package io.dekorate.kubernetes.decorator;


#set ($targetfn = ${model.implementsList[0].arguments[0].fullyQualifiedName})
#set ($tindex = $targetfn.lastIndexOf(".") + 1)
#set ($target = $targetfn.substring($tindex))
#set ($parent = ${model.implementsList[0].arguments[1].fullyQualifiedName})

// ${model.name}
// ${model.implementsList[0].arguments[1].name}
// ${model.implementsList[0].arguments[1].fullyQualifiedName}
// ${model.getImplementsList}
// $model.getImplementsList.get(0)
import io.dekorate.deps.kubernetes.api.builder.Function;
import io.dekorate.deps.kubernetes.api.model.Doneable;

import $parent;
import io.dekorate.kubernetes.decorator.Decorator;
import io.dekorate.deps.kubernetes.api.model.$target;
import io.dekorate.deps.kubernetes.api.model.${target}Builder;
import io.dekorate.deps.kubernetes.api.model.${target}FluentImpl;

public class ${target}FluentVisitor extends ${target}FluentImpl<${target}FluentVisitor> implements Doneable<Decorator<$parent>> {

    private final ${target}Builder builder;
    private final io.dekorate.deps.kubernetes.api.builder.Function<$target,Decorator<$parent>> function;

    public ${target}FluentVisitor(io.dekorate.deps.kubernetes.api.builder.Function<$target,Decorator<$parent>> function){
    super();this.builder=new ${target}Builder(this);this.function=function;
    }
    public ${target}FluentVisitor($target item,io.dekorate.deps.kubernetes.api.builder.Function<$target,Decorator<$parent>> function){
    super(item);this.builder=new ${target}Builder(this, item);this.function=function;
    }

    public Decorator<$parent> done(){
    return function.apply(builder.build());
    }
 }
