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

com.github.bloodshura.ignitium.cfg.props.serial.PropertyEntry Maven / Gradle / Ivy

Go to download

A collection of configuration and serialization readers and writers, like JSON, internationalization (I18n), and CSV.

There is a newer version: 1.0.1
Show newest version
package com.github.bloodshura.ignitium.cfg.props.serial;

import com.github.bloodshura.ignitium.object.Base;

import javax.annotation.Nonnull;

public class PropertyEntry extends Base {
	public static final int ENFORCE_CHAR = 1;
	public static final int ENFORCE_NONE = 0;
	public static final int ENFORCE_STRING = 2;
	public final int enforce;
	public final Object object;
	public final Type type;

	public PropertyEntry(@Nonnull Type type, @Nonnull Object object, boolean hadQuotes, boolean simpleQuote) {
		this(type, object, hadQuotes ? (simpleQuote ? ENFORCE_CHAR : ENFORCE_STRING) : ENFORCE_NONE);
	}

	public PropertyEntry(@Nonnull Type type, @Nonnull Object object, int enforce) {
		this.enforce = enforce;
		this.object = object;
		this.type = type;
	}

	@Nonnull
	@Override
	protected Object[] stringValues() {
		return new Object[] { type, enforce, object };
	}

	public static enum Type {
		KEY_DEF,
		VALUE_DEF
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy