keplerk
keplerk
JCHJava Community | Help. Code. Learn.
Created by keplerk on 11/16/2024 in #java-help
JSON Schema Validator with message option
Hi People, I'm using Katalon for test design and i need to validate a json response against an schema, but most of the ones i've found doesn't allow me to set a custom error message in case any specific part of the schema fails the validation. The question is, is there any java json schema validator that works with java 8 and allows me to set custom error messages to the schema parts ? Regards and thanks you.
9 replies
JCHJava Community | Help. Code. Learn.
Created by keplerk on 10/2/2024 in #java-help
Get method name within an annotation dinamically
Hi guys, is possible to get the method name from which a custom annotation is being called? E.x.
@MyCustomAnnotation
public void myMethod(){}
@MyCustomAnnotation
public void myMethod(){}
From the aspect processing MyCustomAnnotation, it's possible to get to know that the method "annotated" it's myMethod ? Thanks ! Edit: The idea is not having to depend in a custom attribute where the method name would be hardcoded
32 replies
JCHJava Community | Help. Code. Learn.
Created by keplerk on 6/24/2024 in #java-help
Recommendation to store permissions
Hi people i would like advices regarding what's the best way to store permissions without ending with a HUGE table in db and having java to properly handle them. I was thinking on using a maybe numeric value, 1 read, 2 write, 4 delete where a value of 5 means it has delete and read value, a value of 6 read write and deleted and such. But i really don't know if there is any other/recommended way. Regards. :PES3_Wave:
8 replies
JCHJava Community | Help. Code. Learn.
Created by keplerk on 5/17/2023 in #java-help
Generic List setter ?
It's possible to have a method that not matter what kind of list you send, it would set it to the corresponding variable ? ex.
List<Foo> foo = new ArrayList();
List<Bar> bar = new ArrayList();

public <T> void setList(List<T> myList){
if(myList instanceof List<Foo>) this.foo = myList;
if(myList instanceof List<Bar>) this.bar = myList;
}
List<Foo> foo = new ArrayList();
List<Bar> bar = new ArrayList();

public <T> void setList(List<T> myList){
if(myList instanceof List<Foo>) this.foo = myList;
if(myList instanceof List<Bar>) this.bar = myList;
}
10 replies