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

org.wildfly.clustering.marshalling.jboss.DefaultObjectTableProvider Maven / Gradle / Ivy

The newest version!
/*
 * Copyright The WildFly Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package org.wildfly.clustering.marshalling.jboss;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Supplier;

import org.jboss.marshalling.ObjectTable;

/**
 * Provides object tables for serializable JDK singleton objects.
 * @author Paul Ferraro
 */
public enum DefaultObjectTableProvider implements Supplier {
	UTIL(List.of(
			Collections.emptyList(),
			Collections.emptyMap(),
			Collections.emptyNavigableMap(),
			Collections.emptyNavigableSet(),
			Collections.emptySet(),
			Collections.emptySortedMap(),
			Collections.emptySortedSet(),
			List.of(),
			Map.of(),
			Set.of())),
	;
	private final ObjectTable table;

	DefaultObjectTableProvider(List objects) {
		this.table = new IdentityObjectTable(objects);
	}

	@Override
	public ObjectTable get() {
		return this.table;
	}
}