forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBeanConverter.java
More file actions
33 lines (30 loc) · 844 Bytes
/
BeanConverter.java
File metadata and controls
33 lines (30 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* Jooby https://jooby.io
* Apache License Version 2.0 https://jooby.io/LICENSE.txt
* Copyright 2014 Edgar Espina
*/
package io.jooby;
import javax.annotation.Nonnull;
/**
* Value converter for complex values that come from query, path, form, etc... parameters into more
* specific type.
*
* It is an extension point for {@link ValueNode#to(Class)} calls.
*/
public interface BeanConverter {
/**
* True if the converter applies for the given type.
*
* @param type Conversion type.
* @return True if the converter applies for the given type.
*/
boolean supports(@Nonnull Class type);
/**
* Convert a node value into more specific type.
*
* @param node Value value.
* @param type Requested type.
* @return Converted value.
*/
Object convert(@Nonnull ValueNode node, @Nonnull Class type);
}