java interface 默认值

/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.annotations;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* Add caching strategy to a root entity or a collection.
*
* @author Emmanuel Bernard
*/
@Target({TYPE, METHOD, FIELD})
@Retention(RUNTIME)
public @interface Cache {
/**
* The concurrency strategy chosen.
*/
CacheConcurrencyStrategy usage();

/**
* The cache region name.
*/
String region() default "";

/**
* How lazy properties are included in the second level cache. Default value is "all"; other allowable
* value: "non-lazy"
*/
String include() default "all";
}

时间: 2024-10-07 07:22:03

java interface 默认值的相关文章

java变量默认值

Java 语言要求变量遵循先定义,再初始化,然后使用的规则.变量的初始化是自从变量定义以后,首次给它赋初值的过程. 一.成员变量 JVM将为类的instance和static变量赋上缺省值(默认值),包括数组array中的每一个元素--而不用再写初始化赋值语句.final变量没有默认值,必须在构造器结束前赋值. 默认值如下: 1.整数类型(byte.short.int.long)默认值为0. 2.单精度浮点型(float)默认值为0.0f. 3.双精度浮点型(double)默认值为0.0d. 4

selenium java清空默认值方法

public ReleaseRequirePage setContactNumber(String phoneNum) { WebElement element=tp.xpathLocator(TradingHallLoc.acontactNumber); element.click(); element.sendKeys(Keys.chord(Keys.CONTROL, "a"));//全选 element.sendKeys(Keys.BACK_SPACE);//退格键删除 elem

Java成员变量默认值

Java中明确规定:1.如果是引用型的,比如:String,还有类对象,他们的默认值都是:null:2.而如果是值类型:double,int,long,float,char等等,他们都是:0:还有一个,boolean,默认值是:false. Boolean falseChar '\u0000'(null)byte (byte)0short (short)0int 0long 0Lfloat 0.0fdouble 0.0d 如果在一个方法中定义一个变量,java不会给其分配默认值,就必须我们来给他

java函数参数默认值

java通过函数的重载来实现函数参数默认值 public class ParameterDefault { /** * @param args */ public String getName(String givenName,String familyName){ return givenName+"."+familyName; } public String getName(String givenName){ return getName(givenName,"Xie&

Java中初始变量默认值

Java语言中有8种基本数据类型,基本情况汇总如下: 序号 数据类型 大小/位 封装类 默认值 可表示数据范围 1 byte(位) 8 Byte 0 -128~127 2 short(短整数) 16 Short 0 -32768~32767 3 int(整数) 32 Integer 0 -2147483648~2147483647 4 long(长整数) 64 Long 0L -9223372036854775808~9223372036854775807 5 float(单精度) 32 Flo

java 反射: 当Timestamp类型的属性值为null时,设置默认值

import java.beans.PropertyDescriptor; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.sql.Timestamp; class Person { private String name; private int age; private Timestamp birth; public Timestamp getBirth() { return birth

(转载)JAVA中八种基本数据类型的默认值

引用 For type byte, the default value is zero, that is, the value of (byte)0. For type short, the default value is zero, that is, the value of (short)0. For type int, the default value is zero, that is, 0. For type long, the default value is zero, that

java字符串转换数值类型出现异常赋予默认值

http://blog.csdn.net/w47_csdn/article/details/77855126 可以自定义工具方法,例如: public static int parseInt(String s, int defaultValue) { if (s == null) return defaultValue; try { return Integer.parseInt(s); } catch (NumberFormatException x) { return defaultValu

Java函数(方法)的默认值问题

Java不能为函数(方法)设置默认参数. 原因是“默认参数”和“方法重载”同时支持的话有二义性的问题,但使用“方法重载”可以间接地实现”默认参数“的效果,例如: public class A{ public void doA(int a){ } public void doA(){ this.doA(0);//这里默认传入0,可以近似认为通过重载实现了默认值的设置 } } 参考: 1)java 能为方法参数设置默认参数吗 原文地址:https://www.cnblogs.com/GjqDream