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

com.gregmarut.support.beangenerator.value.StaticValue Maven / Gradle / Ivy

Go to download

Supports unit testing by dynamically creating bean objects and populating their fields to default values.

There is a newer version: 2.7-RELEASE
Show newest version
/*******************************************************************************
 * 
 * Copyright (c) 2015 Greg Marut.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl.html
 * 
 * Contributors:
 *     Greg Marut - initial API and implementation
 * 
******************************************************************************/ package com.gregmarut.support.beangenerator.value; import java.lang.reflect.Field; /** * Represents a value that never changes * * @author Greg Marut * @param */ public class StaticValue implements Value { private final Class type; private final V value; public StaticValue(final V value, final Class type) { this.value = value; this.type = type; } @Override public Class getType() { return type; } @Override public V getValue() { return value; } @Override public V getValue(final Field field) { return value; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy