io.vulpine.lib.json.schema.v4.impl.NullChildSchemaImpl Maven / Gradle / Ivy
package io.vulpine.lib.json.schema.v4.impl;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import io.vulpine.lib.json.schema.v4.*;
import io.vulpine.lib.json.schema.SchemaBuilder;
import io.vulpine.lib.json.schema.v4.impl.lib.Setter;
class NullChildSchemaImpl
extends NullSchemaImpl
implements NullChildSchema
{
private final Setter setter;
private final P parent;
NullChildSchemaImpl(
P parent,
ObjectMapper jax,
ObjectNode raw,
Setter setter
)
{
super(jax, raw);
this.parent = parent;
this.setter = setter;
}
// ┌─────────────────────────────────────────────────────┐
// │ │
// │ Interface implementation │
// │ │
// └─────────────────────────────────────────────────────┘
@Override
public P close()
{
setter.accept(this);
return parent;
}
// ┌─────────────────────────────────────────────────────┐
// │ │
// │ Return type overrides │
// │ │
// └─────────────────────────────────────────────────────┘
@Override
@SuppressWarnings("unchecked")
public NullChildSchema
id(String id)
{
return (NullChildSchema
) super.id(id);
}
@Override
@SuppressWarnings("unchecked")
public NullChildSchema
removeId()
{
return (NullChildSchema
) super.removeId();
}
@Override
@SuppressWarnings("unchecked")
public NullChildSchema
$schema(String path)
{
return (NullChildSchema
) super.$schema(path);
}
@Override
@SuppressWarnings("unchecked")
public NullChildSchema
remove$Schema()
{
return (NullChildSchema
) super.remove$Schema();
}
@Override
@SuppressWarnings("unchecked")
public NullChildSchema
$ref(String path)
{
return (NullChildSchema
) super.$ref(path);
}
@Override
@SuppressWarnings("unchecked")
public NullChildSchema
remove$Ref()
{
return (NullChildSchema
) super.remove$Ref();
}
@Override
@SuppressWarnings("unchecked")
public NullChildSchema
description(String desc)
{
return (NullChildSchema
) super.description(desc);
}
@Override
@SuppressWarnings("unchecked")
public NullChildSchema
removeDescription()
{
return (NullChildSchema
) super.removeDescription();
}
@Override
@SuppressWarnings("unchecked")
public NullChildSchema
title(String title)
{
return (NullChildSchema
) super.title(title);
}
@Override
@SuppressWarnings("unchecked")
public NullChildSchema
removeTitle()
{
return (NullChildSchema
) super.removeTitle();
}
@Override
@SuppressWarnings("unchecked")
public NullChildSchema
removeDefault()
{
return (NullChildSchema
) super.removeDefault();
}
@Override
public UntypedChildSchema extends NullChildSchema
> definition(String k)
{
return new UntypedChildSchemaImpl<>(this, jax(), newObj(),
v -> definition(k, v));
}
@Override
@SuppressWarnings("unchecked")
public NullChildSchema
definition(String name, SchemaBuilder schema)
{
return (NullChildSchema
) super.definition(name, schema);
}
@Override
@SuppressWarnings("unchecked")
public NullChildSchema
removeDefinition(String name)
{
return (NullChildSchema
) super.removeDefinition(name);
}
@Override
@SuppressWarnings("unchecked")
public NullChildSchema
removeDefinitions()
{
return (NullChildSchema
) super.removeDefinitions();
}
@Override
public ArrayChildSchema
orAsArray()
{
return new ArrayChildSchemaImpl<>(parent, jax(), copy(), setter);
}
@Override
public BooleanChildSchema
orAsBoolean()
{
return new BooleanChildSchemaImpl<>(parent, jax(), copy(), setter);
}
@Override
public IntegerChildSchema
orAsInteger()
{
return new IntegerChildSchemaImpl<>(parent, jax(), copy(), setter);
}
@Override
public NumberChildSchema
orAsNumber()
{
return new NumberChildSchemaImpl<>(parent, jax(), copy(), setter);
}
@Override
public ObjectChildSchema
orAsObject()
{
return new ObjectChildSchemaImpl<>(parent, jax(), copy(), setter);
}
@Override
public StringChildSchema
orAsString()
{
return new StringChildSchemaImpl<>(parent, jax(), copy(), setter);
}
@Override
@SuppressWarnings("unchecked")
public NullChildSchema
defaultValue(JsonNode val)
{
return (NullChildSchema
) super.defaultValue(val);
}
@Override
@SuppressWarnings("unchecked")
public UntypedChildSchema extends NullChildSchema
> not()
{
return (UntypedChildSchema extends NullChildSchema
>) super.not();
}
}