Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6812881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:30:12+00:00 2026-05-26T20:30:12+00:00

Typefactory class at jackson has many deprecated methods inside it. I am using it

  • 0

Typefactory class at jackson has many deprecated methods inside it. I am using it like that:

public List<T> getX(Class<T> clz) {
    ObjectMapper mapper = new ObjectMapper();
    try {
        String jsonData = mapper.writeValueAsString(data);
        a = mapper.readValue(jsonData, TypeFactory.collectionType(List.class, clz));
    } catch (Exception e) {
        System.out.println(e.getMessage());
    }
    return a;// a is a global variable
}

and it warns me that collectionType is deprecated. What to use instead of it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:30:13+00:00Added an answer on May 26, 2026 at 8:30 pm

    TypeFactory itself is NOT deprecated, just static methods; instance methods like “constructType” are available. So question is rather where do you get a TypeFactory instance to use.

    Most often you get an instance from ObjectMapper using its getTypeFactory method; or from SerializationConfig / DeserializationConfig. They carry an instance around.
    If none of these works, there is TypeFactory.instance as well that you can use.

    The reason for deprecation is that some extension modules will want to replace the standard factory: specifically, Scala module needs to extend type handling with Scala Collection (etc) types — these will not work by default, since Scala does not extend java.util versions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple class that imports another class from another jar. Everything compiles
I am using DbUnit in the latest version 2.4.8 and I get many warnings
I'm experementing with Jackson serialization/deserialization. For instance, I have such class: class Base{ String
I know this has been discussed ad nauseum...but I have an issue with the
Just like I can set the DefaultControllerFactory to my own in the global.asax by
I'm learning how to use Windsor TypedFactory: that feature it's just awesome! I made
I have the fallowing problem: I have to tables SalesHeader and SalesPosition - where
I have a Java application where I use Akka Typed Actors . The code
I'm new to the Akka framework and I'm building an HTTP server application on
Is there any way I can filter my NHibernate query on the SubType field

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.