• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AutoMatter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中io.norberg.automatter.AutoMatter的典型用法代码示例。如果您正苦于以下问题:Java AutoMatter类的具体用法?Java AutoMatter怎么用?Java AutoMatter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AutoMatter类属于io.norberg.automatter包,在下文中一共展示了AutoMatter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: Value

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
private Value(@AutoMatter.Field("field1") T1 field1, @AutoMatter.Field("field2") T2 field2, @AutoMatter.Field("field3") T3 field3, @AutoMatter.Field("field4") T4 field4, @AutoMatter.Field("plain") String plain) {
  if (field1 == null) {
    throw new NullPointerException("field1");
  }
  if (field2 == null) {
    throw new NullPointerException("field2");
  }
  if (field3 == null) {
    throw new NullPointerException("field3");
  }
  if (field4 == null) {
    throw new NullPointerException("field4");
  }
  if (plain == null) {
    throw new NullPointerException("plain");
  }
  this.field1 = field1;
  this.field2 = field2;
  this.field3 = field3;
  this.field4 = field4;
  this.plain = plain;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:23,代码来源:GenericMultipleBuilder.java


示例2: valueGetter

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
private MethodSpec valueGetter(final Descriptor d, final ExecutableElement field) throws AutoMatterProcessorException {
  String fieldName = fieldName(field);

  return MethodSpec.methodBuilder(fieldName)
      .addAnnotation(AutoMatter.Field.class)
      .addAnnotation(Override.class)
      .addModifiers(PUBLIC)
      .returns(fieldType(d, field))
      .addStatement("return $N", fieldName)
      .build();
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:12,代码来源:AutoMatterProcessor.java


示例3: Value

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
private Value(@AutoMatter.Field("foo") Optional<String> foo,
              @AutoMatter.Field("bar") Optional<String> bar) {
  if (foo == null) {
    throw new NullPointerException("foo");
  }
  this.foo = foo;
  this.bar = bar;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:9,代码来源:GuavaOptionalFieldsBuilder.java


示例4: Value

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
private Value(@AutoMatter.Field("foo") Optional<T> foo, @AutoMatter.Field("bar") Optional<T> bar) {
  if (foo == null) {
    throw new NullPointerException("foo");
  }
  this.foo = foo;
  this.bar = bar;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:8,代码来源:GenericJUTOptionalFieldsBuilder.java


示例5: Value

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
private Value(@AutoMatter.Field("foo") String foo, @AutoMatter.Field("bar") Integer bar, @AutoMatter.Field("baz") int baz) {
  if (foo == null) {
    throw new NullPointerException("foo");
  }
  if (bar == null) {
    throw new NullPointerException("bar");
  }
  this.foo = foo;
  this.bar = bar;
  this.baz = baz;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:12,代码来源:FoobarBuilder.java


示例6: Value

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
private Value(@AutoMatter.Field("foo") String foo, @AutoMatter.Field("bar") T bar, @AutoMatter.Field("baz") int baz) {
  if (foo == null) {
    throw new NullPointerException("foo");
  }
  if (bar == null) {
    throw new NullPointerException("bar");
  }
  this.foo = foo;
  this.bar = bar;
  this.baz = baz;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:12,代码来源:GenericFoobarBuilder.java


示例7: Value

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
private Value(
    @AutoMatter.Field("aBoolean") boolean aBoolean,
    @AutoMatter.Field("aByte") byte aByte,
    @AutoMatter.Field("aShort") short aShort,
    @AutoMatter.Field("aInt") int aInt,
    @AutoMatter.Field("aLong") long aLong,
    @AutoMatter.Field("aChar") char aChar,
    @AutoMatter.Field("aFloat") float aFloat,
    @AutoMatter.Field("aDouble") double aDouble,
    @AutoMatter.Field("object") Object object,
    @AutoMatter.Field("array") Object[] array
) {
  if (object == null) {
    throw new NullPointerException("object");
  }
  if (array == null) {
    throw new NullPointerException("array");
  }
  this.aBoolean = aBoolean;
  this.aByte = aByte;
  this.aShort = aShort;
  this.aInt = aInt;
  this.aLong = aLong;
  this.aChar = aChar;
  this.aFloat = aFloat;
  this.aDouble = aDouble;
  this.object = object;
  this.array = array;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:30,代码来源:FooBuilder.java


示例8: Value

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
private Value(@AutoMatter.Field("strings") List<String> strings,
              @AutoMatter.Field("integers") Map<String,Integer> integers,
              @AutoMatter.Field("numbers") Set<Long> numbers) {
  this.strings = strings;
  this.integers = integers;
  this.numbers = numbers;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:8,代码来源:NullableCollectionFieldsBuilder.java


示例9: Value

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
private Value(@AutoMatter.Field("strings") List<String> strings,
              @AutoMatter.Field("integers") Map<String,Integer> integers,
              @AutoMatter.Field("numbers") Set<Long> numbers) {
  this.strings = (strings != null) ? strings : Collections.<String>emptyList();
  this.integers = (integers != null) ? integers : Collections.<String,Integer>emptyMap();
  this.numbers = (numbers != null) ? numbers : Collections.<Long>emptySet();
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:8,代码来源:CollectionFieldsBuilder.java


示例10: Value

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
private Value(
    @AutoMatter.Field("nullableFoo") String nullableFoo,
    @AutoMatter.Field("customNullableBar") String customNullableBar,
    @AutoMatter.Field("nonNullQuux") String nonNullQuux,
    @AutoMatter.Field("nonNullPrimitive") int nonNullPrimitive
) {
  if (nonNullQuux == null) {
    throw new NullPointerException("nonNullQuux");
  }
  this.nullableFoo = nullableFoo;
  this.customNullableBar = customNullableBar;
  this.nonNullQuux = nonNullQuux;
  this.nonNullPrimitive = nonNullPrimitive;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:15,代码来源:NullableFieldsBuilder.java


示例11: findImplicitPropertyName

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
@Override
public String findImplicitPropertyName(final AnnotatedMember member) {
  final AutoMatter.Field field = member.getAnnotation(AutoMatter.Field.class);
  if (field == null) {
    return null;
  }
  if (member instanceof AnnotatedParameter) {
    return field.value();
  }
  if (member instanceof AnnotatedMethod) {
    return member.getName();
  }
  return null;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:15,代码来源:AutoMatterAnnotationIntrospector.java


示例12: hasCreatorAnnotation

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
@Override
public boolean hasCreatorAnnotation(final Annotated a) {
  if (!(a instanceof AnnotatedConstructor)) {
    return false;
  }
  final AnnotatedConstructor ctor = (AnnotatedConstructor) a;
  if (ctor.getParameterCount() == 0) {
    return true;
  }
  final AutoMatter.Field field = ctor.getParameter(0).getAnnotation(AutoMatter.Field.class);
  return field != null;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:13,代码来源:AutoMatterAnnotationIntrospector.java


示例13: resolveAbstractType0

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
private JavaType resolveAbstractType0(final DeserializationConfig config, final Class<?> rawClass) {
  final AutoMatter annotation = rawClass.getAnnotation(AutoMatter.class);
  if (annotation == null) {
    // This was not an @AutoMatter type.
    return null;
  }

  // Return the cached type, if present.
  final JavaType cached = types.get(rawClass);
  if (cached != null) {
    return cached;
  }

  // Look up and instantiate the value class
  final String packageName = rawClass.getPackage().getName();
  final String name = rawClass.getSimpleName();
  final String valueName = packageName + '.' + name + VALUE_SUFFIX;
  final Class<?> cls;
  try {
    cls = Class.forName(valueName);
  } catch (ClassNotFoundException e) {
    throw new IllegalArgumentException("No builder found for @AutoMatter type: " + name, e);
  }
  final JavaType materialized = config.getTypeFactory().constructType(cls);

  // Cache the materialized type before returning
  final JavaType existing = types.putIfAbsent(rawClass, materialized);
  return (existing != null) ? existing : materialized;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:30,代码来源:AutoMatterResolver.java


示例14: getSupportedAnnotationTypes

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
@Override
public Set<String> getSupportedAnnotationTypes() {
  return ImmutableSet.of(AutoMatter.class.getName());
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:5,代码来源:AutoMatterProcessor.java


示例15: foo

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
@AutoMatter.Field
@Override
public Optional<String> foo() {
  return foo;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:6,代码来源:GuavaOptionalFieldsBuilder.java


示例16: bar

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
@AutoMatter.Field
@Override
public Optional<String> bar() {
  return bar;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:6,代码来源:GuavaOptionalFieldsBuilder.java


示例17: foo

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
@AutoMatter.Field
@Override
public Optional<T> foo() {
  return foo;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:6,代码来源:GenericJUTOptionalFieldsBuilder.java


示例18: bar

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
@AutoMatter.Field
@Override
public Optional<T> bar() {
  return bar;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:6,代码来源:GenericJUTOptionalFieldsBuilder.java


示例19: foo

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
@AutoMatter.Field
@Override
public String foo() {
  return foo;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:6,代码来源:FoobarBuilder.java


示例20: bar

import io.norberg.automatter.AutoMatter; //导入依赖的package包/类
@AutoMatter.Field
@Override
public Integer bar() {
  return bar;
}
 
开发者ID:danielnorberg,项目名称:auto-matter,代码行数:6,代码来源:FoobarBuilder.java



注:本文中的io.norberg.automatter.AutoMatter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WsdlBindingSubject类代码示例发布时间:2022-05-23
下一篇:
Java ExecuteListener类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap