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

  • Home
  • SEARCH
  • 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 8141241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:26:30+00:00 2026-06-06T12:26:30+00:00

I recently learnt about the benefits of EnumMap in Java and would like to

  • 0

I recently learnt about the benefits of EnumMap in Java and would like to replace the existing ImmutableMap<OccupancyType, BigDecimal> to EnumMap. However, I’d also like the immutable property offered by ImmutableMap.

  • Is there a variant, ImmutableEnumMap available in guava ?
  • In terms of storage which one (EnumMap vs ImmutableMap) performs better ?
  • I couldn’t find a comparison of the two. I’d appreciate if someone can point me to a link or give some insights on the efficiency of the two data structures ?
  • 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-06-06T12:26:33+00:00Added an answer on June 6, 2026 at 12:26 pm

    Guava contributor here.

    Guava doesn’t currently have an ImmutableEnumMap variant, but if it did, it would probably just be a wrapper around an EnumMap. (That said, slightly better immutable implementations are possible.)

    EnumMap will perform better than the basic ImmutableMap, in any event; it’s difficult or impossible to beat.

    (I’ll file an issue to investigate adding an ImmutableMap variant for enum key types, though.)


    Update: Guava 14 adds Maps.immutableEnumMap().

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

Sidebar

Related Questions

I have recently learnt about namespaces in PHP, and was wondering, would it be
I've recently learnt about interface blocks when adding a function to my Fortran program.
I recently learned about Java's security model. Most people think Java is secure because
I've recently learnt about CNS and FNS , and since they look so elegant
My app is ready for submission now but I have recently learnt about Licensing.
When I started to learn about WPF and MVVM recently, I came across some
I recently learnt Python. I liked it. I just wanted to use it for
I've recently been trying to learn me a Haskell, and I'd like to create
I just recently started with object oriented programming, using java. Before I was programming
I do most of my development in Java and C++ but recently had to

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.