'from' method in bean encoding